mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
- 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:
parent
353ae58964
commit
3eec7620be
4 changed files with 38 additions and 43 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue