I have a list of words as below: STR = ['aa', 'dffg', 'aa2', 'AAA3'] I want to get a list of elements from the above list that match a string: to_match = 'aa' I tried the code below: import re [re.findall(to_match, iWord) for iWord in STR] # [['aa'], [], ['aa'], []] However, I wanted to get a list like ['aa', 'aa2', 'AAA3']. Continue reading...