I am splitting a string without removing delimiters, by putting the entire capture regex in parentheses. The intent is to match sentences ending in one or more '[!?]' characters.
All is great except I now get unwanted empty capture groups - how to suppress those, in the least hackish and most regexish way?
>>> re.compile(r'([^!?]*[!?]+)').split('Great customer service! Very happy! Will go again')
['', 'Great customer service!', '', ' Very happy!', ' Will go again']
>>> re.compile(r'([^!?]{2,}[!?]+)').split('Great customer service! Very happy! Will go again')
['', 'Great customer service!', '', ' Very happy!', ' Will go again']
(This is all deeply nested inside more complex regexes and subfunctions, so really don't want hacks. I want the solution to be regexish so I can fold it into a more complex regex)