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 r.david.murray
Recipients Wellington.Fan, ezio.melotti, mrabarnett, r.david.murray
Date 2014-05-21.16:02:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1400688163.3.0.114163716696.issue21551@psf.upfronthosting.co.za>
In-reply-to
Content
"Note that split will never split a string on an empty pattern match"

You can get what you want this way:

>>> re.split(r'(\w*)', 'a funky string')
['', 'a', ' ', 'funky', ' ', 'string', '']

Or use r'(\W*)' if you don't actually want the leading and training empty strings.
History
Date User Action Args
2014-05-21 16:02:43r.david.murraysetrecipients: + r.david.murray, ezio.melotti, mrabarnett, Wellington.Fan
2014-05-21 16:02:43r.david.murraysetmessageid: <1400688163.3.0.114163716696.issue21551@psf.upfronthosting.co.za>
2014-05-21 16:02:43r.david.murraylinkissue21551 messages
2014-05-21 16:02:42r.david.murraycreate