import retext = 'ABC abcabc fff abcabcabc'print( re.findall(r'(?:abc)+', text, flags=re.I) )
Standard input is empty
['ABC', 'abcabc', 'abcabcabc']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!