diff -urNp a/asciidoc.conf b/asciidoc.conf --- a/asciidoc.conf 2018-12-03 13:06:23.377407390 +0100 +++ b/asciidoc.conf 2018-12-03 13:07:08.142320548 +0100 @@ -29,7 +29,7 @@ empty= sp=" " # Attribute and AttributeList element patterns. attributeentry-pattern=^:(?P\w[^.]*?)(\.(?P.*?))?:(\s+(?P.*))?$ -attributelist-pattern=(?u)(^\[\[(?P[\w_:][\w_:.-]*)(,(?P.*?))?\]\]$)|(^\[(?P.*)\]$) +attributelist-pattern=(^\[\[(?P[\w_:][\w_:.-]*)(,(?P.*?))?\]\]$)|(^\[(?P.*)\]$) # Substitution attributes for escaping AsciiDoc processing. amp=& lt=< @@ -288,10 +288,10 @@ endif::no-inline-literal[] # Block macros #------------- # Macros using default syntax. -(?u)^(?Pimage|unfloat|toc)::(?P\S*?)(\[(?P.*?)\])$=# +^(?Pimage|unfloat|toc)::(?P\S*?)(\[(?P.*?)\])$=# # Passthrough macros. -(?u)^(?Ppass)::(?P\S*?)(\[(?P.*?)\])$=# +^(?Ppass)::(?P\S*?)(\[(?P.*?)\])$=# ^'{3,}$=#ruler ^<{3,}$=#pagebreak diff -urNp a/asciidoc.py b/asciidoc.py --- a/asciidoc.py 2018-12-03 13:06:23.378407388 +0100 +++ b/asciidoc.py 2018-12-03 13:17:41.965990011 +0100 @@ -30,7 +30,7 @@ SUBS_NORMAL = ('specialcharacters','quot 'specialwords','replacements','macros','replacements2') SUBS_VERBATIM = ('specialcharacters','callouts') -NAME_RE = r'(?u)[^\W\d][-\w]*' # Valid section or attribute name. +NAME_RE = r'[^\W\d][-\w]*' # Valid section or attribute name. OR, AND = ',', '+' # Attribute list separators. @@ -463,7 +463,7 @@ def parse_options(options,allowed,errmsg def symbolize(s): """Drop non-symbol characters and convert to lowercase.""" - return re.sub(r'(?u)[^\w\-_]', '', s).lower() + return re.sub(r'[^\w\-_]', '', s).lower() def is_name(s): """Return True if s is valid attribute, macro or tag name @@ -1746,7 +1746,7 @@ class AttributeEntry: attr.name = attr.name[:-1] attr.value = None # Strip white space and illegal name chars. - attr.name = re.sub(r'(?u)[^\w\-_]', '', attr.name).lower() + attr.name = re.sub(r'[^\w\-_]', '', attr.name).lower() # Don't override most command-line attributes. if attr.name in config.cmd_attrs \ and attr.name not in ('trace','numbered'): @@ -1946,7 +1946,7 @@ class Title: if ul != s[:ul_len]: return False # Don't be fooled by back-to-back delimited blocks, require at # least one alphanumeric character in title. - if not re.search(r'(?u)\w',title): return False + if not re.search(r'\w',title): return False mo = re.match(Title.pattern, title) if mo: Title.attributes = mo.groupdict() @@ -2104,7 +2104,7 @@ class Section: """ # Replace non-alpha numeric characters in title with underscores and # convert to lower case. - base_id = re.sub(r'(?u)\W+', '_', title).strip('_').lower() + base_id = re.sub(r'\W+', '_', title).strip('_').lower() if 'ascii-ids' in document.attributes: # Replace non-ASCII characters with ASCII equivalents. import unicodedata @@ -3602,7 +3602,7 @@ class Tables(AbstractBlocks): class Macros: # Default system macro syntax. - SYS_RE = r'(?u)^(?P[\\]?\w(\w|-)*?)::(?P\S*?)' + \ + SYS_RE = r'^(?P[\\]?\w(\w|-)*?)::(?P\S*?)' + \ r'(\[(?P.*?)\])$' def __init__(self): self.macros = [] # List of Macros. @@ -4478,7 +4478,7 @@ class Config: rdr.open(fname) message.linenos = None self.fname = fname - reo = re.compile(r'(?u)^\[(?P
\+?[^\W\d][\w-]*)\]\s*$') + reo = re.compile(r'^\[(?P
\+?[^\W\d][\w-]*)\]\s*$') sections = OrderedDict() section,contents = '',[] while not rdr.eof(): diff -urNp a/doc/asciidoc.conf b/doc/asciidoc.conf --- a/doc/asciidoc.conf 2018-12-03 13:06:23.379407386 +0100 +++ b/doc/asciidoc.conf 2018-12-03 13:07:32.374272984 +0100 @@ -3,5 +3,5 @@ # [specialwords] ifndef::doctype-manpage[] -monospacedwords=(?u)\\?\basciidoc\(1\) (?u)\\?\ba2x\(1\) +monospacedwords=\\?\basciidoc\(1\) \\?\ba2x\(1\) endif::doctype-manpage[] diff -urNp a/docbook45.conf b/docbook45.conf --- a/docbook45.conf 2018-12-03 13:06:23.383407378 +0100 +++ b/docbook45.conf 2018-12-03 13:07:53.221231766 +0100 @@ -47,7 +47,7 @@ latexmath-style=template="latexmathblock [macros] # math macros. (?su)[\\]?(?Platexmath):(?P\S*?)\[(?:\$\s*)?(?P.*?)(?:\s*\$)?(?latexmath)::(?P\S*?)(\[(?:\\\[\s*)?(?P.*?)(?:\s*\\\])?\])$=#[] +^(?Platexmath)::(?P\S*?)(\[(?:\\\[\s*)?(?P.*?)(?:\s*\\\])?\])$=#[] [latexmath-inlinemacro] diff -urNp a/examples/website/layout1.conf b/examples/website/layout1.conf --- a/examples/website/layout1.conf 2018-12-03 13:06:23.384407377 +0100 +++ b/examples/website/layout1.conf 2018-12-03 13:08:17.989182454 +0100 @@ -22,7 +22,7 @@ # xhtml11 backend stylesheets. [specialwords] -monospacedwords=(?u)\\?\basciidoc\(1\) (?u)\\?\ba2x\(1\) +monospacedwords=\\?\basciidoc\(1\) \\?\ba2x\(1\) [header] audio|video)::(?P\S*?)(\[(?P.*?)\])$=# +^(?Paudio|video)::(?P\S*?)(\[(?P.*?)\])$=# # math macros. # Special characters are escaped in HTML math markup. (?su)[\\]?(?Pasciimath):(?P\S*?)\[(?P.*?)(?asciimath)::(?P\S*?)(\[(?P.*?)\])$=#[specialcharacters] +^(?Pasciimath)::(?P\S*?)(\[(?P.*?)\])$=#[specialcharacters] (?su)[\\]?(?Platexmath):(?P\S*?)\[(?:\$\s*)?(?P.*?)(?:\s*\$)?(?latexmath)::(?P\S*?)(\[(?:\\\[\s*)?(?P.*?)(?:\s*\\\])?\])$=#[specialcharacters] +^(?Platexmath)::(?P\S*?)(\[(?:\\\[\s*)?(?P.*?)(?:\s*\\\])?\])$=#[specialcharacters] [asciimath-inlinemacro] `{passtext}` diff -urNp a/xhtml11.conf b/xhtml11.conf --- a/xhtml11.conf 2018-12-03 13:06:23.395407355 +0100 +++ b/xhtml11.conf 2018-12-03 13:09:18.358060798 +0100 @@ -39,9 +39,9 @@ latexmath-style=template="latexmathblock # math macros. # Special characters are escaped in HTML math markup. (?su)[\\]?(?Pasciimath):(?P\S*?)\[(?P.*?)(?asciimath)::(?P\S*?)(\[(?P.*?)\])$=#[specialcharacters] +^(?Pasciimath)::(?P\S*?)(\[(?P.*?)\])$=#[specialcharacters] (?su)[\\]?(?Platexmath):(?P\S*?)\[(?:\$\s*)?(?P.*?)(?:\s*\$)?(?latexmath)::(?P\S*?)(\[(?:\\\[\s*)?(?P.*?)(?:\s*\\\])?\])$=#[specialcharacters] +^(?Platexmath)::(?P\S*?)(\[(?:\\\[\s*)?(?P.*?)(?:\s*\\\])?\])$=#[specialcharacters] [asciimath-inlinemacro] `{passtext}`