Message234678
Looks like it works exactly as the docs[1] describe:
>>> re.split(r'\s*[+/&;,]\s*|\s+and\s+', string)
['Dave', 'Sam', 'Jane', 'Zoe']
You're using capturing groups (parentheses) in your original regex which returns separators as part of a match.
[1] https://docs.python.org/3/library/re.html#re.split |
|
Date |
User |
Action |
Args |
2015-01-25 18:10:22 | SilentGhost | set | recipients:
+ SilentGhost, ezio.melotti, mrabarnett, dnotmanj |
2015-01-25 18:10:22 | SilentGhost | set | messageid: <1422209422.52.0.448572609575.issue23318@psf.upfronthosting.co.za> |
2015-01-25 18:10:22 | SilentGhost | link | issue23318 messages |
2015-01-25 18:10:22 | SilentGhost | create | |
|