Message147066
If you split a string in a maximum of zero places, you should get the original string back. "".split(s,0) behaves this way. But re.split(r,s,0) performs an unlimited number of splits in this case.
To get an unlimited number of splits, "".split(s,-1) is a sensible choice. But in this case re.split(r,s,-1) performs zero splits.
Where's the sense in this?
>>> import string, re
>>> string.split("foo bar baz"," ",0)
['foo bar baz']
>>> re.split("\s+","foo bar baz",0)
['foo', 'bar', 'baz']
>>> string.split("foo bar baz"," ",-1)
['foo', 'bar', 'baz']
>>> re.split("\s+","foo bar baz",-1)
['foo bar baz'] |
|
Date |
User |
Action |
Args |
2011-11-05 02:46:36 | acg | set | recipients:
+ acg |
2011-11-05 02:46:36 | acg | set | messageid: <1320461196.01.0.560612390683.issue13346@psf.upfronthosting.co.za> |
2011-11-05 02:46:35 | acg | link | issue13346 messages |
2011-11-05 02:46:34 | acg | create | |
|