mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
- fixed another split problem
(those semantics are weird...) - got rid of $Id$'s (for the moment, at least). in other words, there should be no more "empty" checkins. - internal: some minor cleanups.
This commit is contained in:
parent
34a96371c3
commit
8094611eb8
6 changed files with 22 additions and 15 deletions
|
@ -1,6 +1,5 @@
|
|||
#
|
||||
# Secret Labs' Regular Expression Engine
|
||||
# $Id$
|
||||
#
|
||||
# re-compatible interface for the sre matching engine
|
||||
#
|
||||
|
@ -135,13 +134,14 @@ def _split(pattern, string, maxsplit=0):
|
|||
if not m:
|
||||
break
|
||||
b, e = m.span()
|
||||
if e == i:
|
||||
if b == e:
|
||||
if i >= len(string):
|
||||
break
|
||||
continue
|
||||
append(string[i:b])
|
||||
if g and b != e:
|
||||
extend(m.groups())
|
||||
i = e
|
||||
n = n + 1
|
||||
if i < len(string):
|
||||
append(string[i:])
|
||||
append(string[i:])
|
||||
return s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue