SilentGhost added the comment: 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 ---------- nosy: +SilentGhost resolution: -> not a bug status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23318> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com