[Python-checkins] CVS: python/dist/src/Lib sre.py,1.36,1.37
Fredrik Lundh
effbot@users.sourceforge.net
Tue, 18 Sep 2001 11:47:11 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv30976/Lib
Modified Files:
sre.py
Log Message:
an SRE bugfix a day keeps Guido away...
#462270: sub-tle difference between pre.sub and sre.sub. PRE ignored
an empty match at the previous location, SRE didn't.
also synced with Secret Labs "sreopen" codebase.
Index: sre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** sre.py 2001/09/04 19:20:06 1.36
--- sre.py 2001/09/18 18:47:09 1.37
***************
*** 46,50 ****
(...) Matches the RE inside the parentheses.
The contents can be retrieved or matched later in the string.
! (?iLmsx) Set the I, L, M, S, or X flag for the RE.
(?:...) Non-grouping version of regular parentheses.
(?P<name>...) The substring matched by the group is accessible by name.
--- 46,50 ----
(...) Matches the RE inside the parentheses.
The contents can be retrieved or matched later in the string.
! (?iLmsx) Set the I, L, M, S, or X flag for the RE (see below).
(?:...) Non-grouping version of regular parentheses.
(?P<name>...) The substring matched by the group is accessible by name.
***************
*** 81,85 ****
compile Compile a pattern into a RegexObject.
purge Clear the regular expression cache.
- template Compile a template pattern, returning a pattern object.
escape Backslash all non-alphanumerics in a string.
--- 81,84 ----
***************
*** 91,99 ****
S DOTALL "." matches any character at all, including the newline.
X VERBOSE Ignore whitespace and comments for nicer looking RE's.
! U UNICODE Use unicode locale.
This module also defines an exception 'error'.
"""
import sre_compile
import sre_parse
--- 90,99 ----
S DOTALL "." matches any character at all, including the newline.
X VERBOSE Ignore whitespace and comments for nicer looking RE's.
! U UNICODE Make \w, \W, \b, \B, dependent on the Unicode locale.
This module also defines an exception 'error'.
"""
+
import sre_compile
import sre_parse
***************
*** 105,109 ****
"UNICODE", "error" ]
! __version__ = "2.1b2"
# this module works under 1.5.2 and later. don't use string methods
--- 105,109 ----
"UNICODE", "error" ]
! __version__ = "2.1.1"
# this module works under 1.5.2 and later. don't use string methods
***************
*** 270,273 ****
--- 270,276 ----
if i < b:
append(text[i:b])
+ elif i == b == e and n:
+ append(text[i:b])
+ continue # ignore empty match at previous position
append(filter(m))
i = e