Example:
s = "Thisissometext andthisissometext"
I want to split the text between "is" and "some":
["Thisis", "sometext andthisis", "sometext"]
If I do this:
re.split("(?<=is)s(?=ome)", s)
--> ['Thisis', 'ometext andthisis', 'ometext']
no 's'
If i do this
re.split("(?<=is)(s)(?=ome)", s)
--> ['Thisis', 's', 'ometext andthisis', 's', 'ometext']
If i do this
re.split("(?<=is)(?=some)", s)
--> ValueError: split() requires a non-empty pattern match.
How can I split a string if there is no delimiter??