Commits

Anonymous committed a20095a

fixed url matching

  • Participants
  • Parent commits e4e9475

Comments (0)

Files changed (1)

File rewriteurls.py

     for pattern, repl in rules.items():
         # Turn r'C:\foo\bar' into r'C:\\foo\\bar' since re.sub
         # does a string decode.
-        pattern = pattern.strip()
+        pattern = '^' + pattern.strip() + '$'
         repl = repl.strip().encode('string-escape')
         # However, we still want to allow back references to go
         # through unharmed, so we turn r'\\1' into r'\1'. Again,