mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Change "[%s]" % string.whitespace to r"\s" in regular expressions.
This commit is contained in:
parent
44d5e0c418
commit
62dfed96be
1 changed files with 3 additions and 4 deletions
|
@ -33,12 +33,11 @@ endtagopen = re.compile('</[<>a-zA-Z]')
|
||||||
endbracket = re.compile('[<>]')
|
endbracket = re.compile('[<>]')
|
||||||
special = re.compile('<![^<>]*>')
|
special = re.compile('<![^<>]*>')
|
||||||
commentopen = re.compile('<!--')
|
commentopen = re.compile('<!--')
|
||||||
commentclose = re.compile('--[%s]*>' % string.whitespace)
|
commentclose = re.compile(r'--\s*>')
|
||||||
tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9]*')
|
tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9]*')
|
||||||
attrfind = re.compile(
|
attrfind = re.compile(
|
||||||
'[%s]*([a-zA-Z_][-.a-zA-Z_0-9]*)' % string.whitespace
|
r'\s*([a-zA-Z_][-.a-zA-Z_0-9]*)(\s*=\s*'
|
||||||
+ ('([%s]*=[%s]*' % (string.whitespace, string.whitespace))
|
r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$\(\)_#=~]*))?')
|
||||||
+ r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$\(\)_#=~]*))?')
|
|
||||||
|
|
||||||
|
|
||||||
# SGML parser base class -- find tags and call handler functions.
|
# SGML parser base class -- find tags and call handler functions.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue