human
Python re.findall print all patterns
assistant
Here is some code to get all matching patterns 'a.*?a' from a string 'a 1 a 2 a 3 a 4 a'.

re.findall('(?=(a.*?a))', 'a 1 a 2 a 3 a 4 a')

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.