summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Doc/library/re.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index d5abcdd2a2..e01a8cc726 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -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])