Commit 222907da authored by Skip Montanaro's avatar Skip Montanaro

Added a note and examples to explain that re.split does not split on an

empty pattern match. (issue 852532).
parent 847cae67
......@@ -544,6 +544,13 @@ form.
>>> re.split('\W+', 'Words, words, words.', 1)
['Words', 'words, words.']
Note that *split* will never split a string on an empty pattern match.
For example ::
>>> re.split('x*', 'foo')
['foo']
>>> re.split("(?m)^$", "foo\n\nbar\n")
['foo\n\nbar\n']
.. function:: findall(pattern, string[, flags])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment