- fixed some re usage, partly so it'll still work when re uses pre instead

of sre, and partly fixing re -> regex porting oversights
- fixed PyFontify.py so it actually *works* again..
This commit is contained in:
Just van Rossum 2001-07-10 19:25:40 +00:00
parent 353ae58964
commit 3eec7620be
4 changed files with 38 additions and 43 deletions

View file

@ -790,7 +790,7 @@ def _escape(where, what) :
def _makewholewordpattern(word):
# first, escape special regex chars
for esc in "\\[]().*^+$?":
for esc in "\\[]()|.*^+$?":
word = _escape(word, esc)
notwordcharspat = '[^' + _wordchars + ']'
pattern = '(' + word + ')'
@ -1166,7 +1166,7 @@ def execstring(pytext, globals, locals, filename="<string>", debugging=0,
PyDebugger.stop()
_identifieRE = re.compile("[A-Za-z_][A-Za-z_0-9]*")
_identifieRE = re.compile(r"[A-Za-z_][A-Za-z_0-9]*")
def identifieRE_match(str):
match = _identifieRE.match(str)