summaryrefslogtreecommitdiff
path: root/pygments/util.py
diff options
context:
space:
mode:
authorDavid Baumgold <david@davidbaumgold.com>2016-12-29 00:26:27 -0500
committerDavid Baumgold <david@davidbaumgold.com>2016-12-29 00:26:27 -0500
commit77e243266f5f25ab9b1f1651547b8279a862e1a3 (patch)
tree4848db6ff3e8e30068db9845fb34c0abffd1db67 /pygments/util.py
parent56e75b33d66738b072f9f5525f3af4a8ba863d8b (diff)
downloadpygments-77e243266f5f25ab9b1f1651547b8279a862e1a3.tar.gz
Pull flags out of regular expressions
Diffstat (limited to 'pygments/util.py')
-rw-r--r--pygments/util.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pygments/util.py b/pygments/util.py
index 07b662d0..7abcc5fd 100644
--- a/pygments/util.py
+++ b/pygments/util.py
@@ -14,7 +14,7 @@ import sys
split_path_re = re.compile(r'[/\\ ]')
-doctype_lookup_re = re.compile(r'''(?smx)
+doctype_lookup_re = re.compile(r'''
(<\?.*?\?>)?\s*
<!DOCTYPE\s+(
[a-zA-Z_][a-zA-Z0-9]*
@@ -23,8 +23,9 @@ doctype_lookup_re = re.compile(r'''(?smx)
"[^"]*")?
)
[^>]*>
-''')
-tag_re = re.compile(r'<(.+?)(\s.*?)?>.*?</.+?>(?uism)')
+''', re.DOTALL | re.MULTILINE | re.VERBOSE)
+tag_re = re.compile(r'<(.+?)(\s.*?)?>.*?</.+?>',
+ re.UNICODE | re.IGNORECASE | re.DOTALL | re.MULTILINE)
xml_decl_re = re.compile(r'\s*<\?xml[^>]*\?>', re.I)