>>> re.findall(r'(test).+(test2)', 'test some text here another test2 more text') [('test', 'test2')] >>> re.findall(r'(test).+(test2)?', 'test some text here another test2 more text') [('test', '')]