Commits

Thomas Waldmann committed 0fdfd6a

regex raw strings: remove redundant escapes

Comments (0)

Files changed (3)

MoinMoin/converter/mediawiki_in.py

 
         def __call__(self, line, tags=[]):
             tags = tags or self.opened_tags
-            match = re.match(r"(.*?)(\<.*\>.*)|(.*)", line)
+            match = re.match(r"(.*?)(<.*>.*)|(.*)", line)
             if match:
                 pre_text = match.group(1) or match.group(3)
                 # text may be None

MoinMoin/converter/rst_in.py

             try:
                 docutils_tree = core.publish_doctree(source=input)
             except utils.SystemMessage as inst:
-                string_numb = re.match(re.compile(r'<string>\:([0-9]*)\:\s*\(.*?\)\s*(.*)',
+                string_numb = re.match(re.compile(r'<string>:([0-9]*):\s*\(.*?\)\s*(.*)',
                                                   re.X | re.U | re.M | re.S), str(inst))
                 if string_numb:
                     str_num = string_numb.group(1)

MoinMoin/mail/sendmail.py

     :returns: encoded address
     """
     assert isinstance(address, unicode)
-    composite = re.compile(r'(?P<phrase>.*?)(?P<blanks>\s*)\<(?P<addr>.*)\>', re.UNICODE)
+    composite = re.compile(r'(?P<phrase>.*?)(?P<blanks>\s*)<(?P<addr>.*)>', re.UNICODE)
     match = composite.match(address)
     if match:
         phrase = match.group('phrase')