This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mrabarnett
Recipients Elias Tarhini, ezio.melotti, mrabarnett
Date 2019-03-23.22:13:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553379224.25.0.528578287088.issue36397@roundup.psfhosted.org>
In-reply-to
Content
The list alternates between substrings (s, between the splits) and captures (c):

['1', '1', '2', '2', '11']
 -s-  -c-  -s-  -c-  -s--

You can use slicing to extract the substrings:

>>> re.split(r'(?<=(\d))(?!\1)(?=\d)', '12111')[ : : 2]
['1', '2', '111']
History
Date User Action Args
2019-03-23 22:13:44mrabarnettsetrecipients: + mrabarnett, ezio.melotti, Elias Tarhini
2019-03-23 22:13:44mrabarnettsetmessageid: <1553379224.25.0.528578287088.issue36397@roundup.psfhosted.org>
2019-03-23 22:13:44mrabarnettlinkissue36397 messages
2019-03-23 22:13:44mrabarnettcreate