diff options
author | Skip Montanaro <skip@pobox.com> | 2007-09-01 17:40:03 (GMT) |
---|---|---|
committer | Skip Montanaro <skip@pobox.com> | 2007-09-01 17:40:03 (GMT) |
commit | 222907da5694097da7a6ee7ad1f89c53e024b550 (patch) | |
tree | 6790cd5a0936a872044776c632fb4c9dc7d3b952 /Doc | |
parent | 847cae6743aa43aa51efae0d8e6066b84a52b9a9 (diff) | |
download | cpython-222907da5694097da7a6ee7ad1f89c53e024b550.zip cpython-222907da5694097da7a6ee7ad1f89c53e024b550.tar.gz cpython-222907da5694097da7a6ee7ad1f89c53e024b550.tar.bz2 |
Added a note and examples to explain that re.split does not split on an
empty pattern match. (issue 852532).
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/re.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst index d5abcdd..e01a8cc 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]) |