pretty strange behavior of "strip"
Mark Tolonen
metolone+gmane at gmail.com
Fri Dec 5 10:54:01 EST 2008
<rdmurray at bitdance.com> wrote in message
news:Pine.LNX.4.64.0812050945320.1160 at kimball.webabinitio.net...
> On Thu, 4 Dec 2008 at 20:54, Terry Reedy wrote:
[snip]
> I have often wished that in 'split' I could specify a _set_ of characters
> on which the string would be split, in the same way the default list
> of whitespace characters causes a split where any one (or more) of
> them appears. But instead the string argument is a multi-character
> separator. (Which is sometimes useful and I wouldn't want to lose the
> ability to specify a multi-character separator!)
>>> import re
>>> re.split('[,.]','blah,blah.blah')
['blah', 'blah', 'blah']
-Mark
More information about the Python-list
mailing list