changeset 2007:0fdfd6a34406

regex raw strings: remove redundant escapes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 17 Feb 2013 17:38:17 +0100
parents 3f08275cd676
children cb2ca948f94b
files MoinMoin/converter/mediawiki_in.py MoinMoin/converter/rst_in.py MoinMoin/mail/sendmail.py
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/mediawiki_in.py	Sun Feb 17 04:02:45 2013 +0100
+++ b/MoinMoin/converter/mediawiki_in.py	Sun Feb 17 17:38:17 2013 +0100
@@ -879,7 +879,7 @@
 
         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
--- a/MoinMoin/converter/rst_in.py	Sun Feb 17 04:02:45 2013 +0100
+++ b/MoinMoin/converter/rst_in.py	Sun Feb 17 17:38:17 2013 +0100
@@ -763,7 +763,7 @@
             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)
--- a/MoinMoin/mail/sendmail.py	Sun Feb 17 04:02:45 2013 +0100
+++ b/MoinMoin/mail/sendmail.py	Sun Feb 17 17:38:17 2013 +0100
@@ -39,7 +39,7 @@
     :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')