I want to implement the following in python.
Given the input:
Text = 'ABC-363738743DEF-2746824769ABC-48738383DEF-437833892'
I want to split this text based on 'ABC' and 'DEF', but also keep them in the output, so I need this:
['ABC-363738743','DEF-2746824769','ABC-48738383','DEF-437833892']
If I use split()
then it deletes ABC and DEF.
Could anyone explain to me how I can get this result?