Use raw strings when escape sequences are needed
[mudpy.git] / mudpy / misc.py
index 470fb96..822beeb 100644 (file)
@@ -299,7 +299,7 @@ class Element:
     def portals(self):
         """Map the portal directions for an area to neighbors."""
         portals = {}
     def portals(self):
         """Map the portal directions for an area to neighbors."""
         portals = {}
-        if re.match("""^area:-?\d+,-?\d+,-?\d+$""", self.key):
+        if re.match(r"""^area:-?\d+,-?\d+,-?\d+$""", self.key):
             coordinates = [(int(x))
                            for x in self.key.split(":")[1].split(",")]
             offsets = dict(
             coordinates = [(int(x))
                            for x in self.key.split(":")[1].split(",")]
             offsets = dict(
@@ -2178,21 +2178,21 @@ def command_show(actor, parameters):
                            "$(eol)$(bld)%s$(nrm)" % e)
     elif arguments[0] == "log":
         if len(arguments) == 4:
                            "$(eol)$(bld)%s$(nrm)" % e)
     elif arguments[0] == "log":
         if len(arguments) == 4:
-            if re.match("^\d+$", arguments[3]) and int(arguments[3]) >= 0:
+            if re.match(r"^\d+$", arguments[3]) and int(arguments[3]) >= 0:
                 stop = int(arguments[3])
             else:
                 stop = -1
         else:
             stop = 0
         if len(arguments) >= 3:
                 stop = int(arguments[3])
             else:
                 stop = -1
         else:
             stop = 0
         if len(arguments) >= 3:
-            if re.match("^\d+$", arguments[2]) and int(arguments[2]) > 0:
+            if re.match(r"^\d+$", arguments[2]) and int(arguments[2]) > 0:
                 start = int(arguments[2])
             else:
                 start = -1
         else:
             start = 10
         if len(arguments) >= 2:
                 start = int(arguments[2])
             else:
                 start = -1
         else:
             start = 10
         if len(arguments) >= 2:
-            if (re.match("^\d+$", arguments[1])
+            if (re.match(r"^\d+$", arguments[1])
                     and 0 <= int(arguments[1]) <= 9):
                 level = int(arguments[1])
             else:
                     and 0 <= int(arguments[1]) <= 9):
                 level = int(arguments[1])
             else: