import retext = r't, train => main,teene!'print( re.findall(r'\bt(?:[a-z]*[a-df-z])?\b', text) )
Standard input is empty
['t', 'train']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!