0

I'm trying to parse a string such as "ABCeRIsqABCSDABCsde" in order to extract "ABCeRIisq", "ABCSD" and "ABCsde".

I've managed to get the first occurrences with a lookahead assertion :

re.findall("ABC.*?(?=ABC)","ABCeRIsqABCSDABCsde")

['ABCeRIisq', 'ABCSD']

How can I get all the occurrences? Is there any way do this without lookahead ?

Thanks!

jmague
  • 572
  • 1
  • 6
  • 13

0 Answers0