Q:

Split string after certain integer character pattern

I have a string stored in variable mystring. I wanted to split the string after a  character 4-digit-integer character pattern i.e (4-digit-integer). I suppose this can be done using Python regex.
mystring = 'Lorem Ipsum (2018) Amet (Lorem Dolor Amet Elit)'

Desired Output :
splitstring = ['Lorem Ipsum (2018)', 'Amet (Lorem Dolor Amet Elit)']

A:

If you don't mind doing some filtering you could do:
import re

string = 'Lorem Ipsum (2018) Amet (Lorem Dolor Amet Elit)'
result = [m for m in re.split('([^\d(]+\(\d{4}\))\s+', string) if m]
print(result)

Output
['Lorem Ipsum (2018)', 'Amet (Lorem Dolor Amet Elit)']

When using split with a capturing group the result will include the group in this case ([^\d(]+\(\d{4}\)) i.e. anything that is not a number nor an open parenthesis followed exactly by four numbers surrounded by parenthesis.
No the that the following spaces \s+ are left out.

