From: Carsten Schoenert <c.schoenert@t-online.de>
Date: Sat, 3 Feb 2024 18:56:27 +0100
Subject: ris.py: Use raw strings for all regexes

Python 3.12 adds a warning for invalid escape sequences (although
they were deprecated since 3.6). Using raw strings in all regexes
avoids it.
---
 src/redfish/ris/ris.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/redfish/ris/ris.py b/src/redfish/ris/ris.py
index ffa50d3..efd3fbf 100644
--- a/src/redfish/ris/ris.py
+++ b/src/redfish/ris/ris.py
@@ -736,7 +736,7 @@ class RisMonolith(Dictable):
         jsonpath_expr = jsonpath_rw.parse('$.."$ref"')
         matches = jsonpath_expr.find(resp.dict)
         respcopy = resp.dict
-        typeregex = "([#,@].*?\.)"
+        typeregex = r"([#,@].*?\.)"
         if matches:
             for match in matches:
                 fullpath = str(match.full_path)
@@ -850,7 +850,7 @@ class RisMonolith(Dictable):
                     if not jsonfile:
                         replacepath = jsonpointer.JsonPointer(jsonpath)
                         schemapath = schemapath.replace("/$ref", "")
-                        if re.search("\[\d]", schemapath):
+                        if re.search(r"\[\d]", schemapath):
                             schemapath = schemapath.translate(str.maketrans("", "", "[]"))
                         schemapath = jsonpointer.JsonPointer(schemapath)
                         data = replacepath.resolve(respcopy)
@@ -911,7 +911,7 @@ class RisMonolith(Dictable):
                     newval = {"$ref": maxsch}
 
             itempath = "/" + getval(match.full_path)
-            if re.search("\[\d+]", itempath):
+            if re.search(r"\[\d+]", itempath):
                 itempath = itempath.translate(str.maketrans("", "", "[]"))
             itempath = jsonpointer.JsonPointer(itempath)
             del itempath.parts[-1]
@@ -947,7 +947,7 @@ class RisMonolith(Dictable):
                         if "anyOf" not in schemapath:
                             raise SchemaValidationError()
                         continue
-                    if re.search("\[\d+]", itempath):
+                    if re.search(r"\[\d+]", itempath):
                         itempath = itempath.translate(str.maketrans("", "", "[]"))
                     itempath = jsonpointer.JsonPointer(itempath)
                     del itempath.parts[-1]
@@ -960,7 +960,7 @@ class RisMonolith(Dictable):
 
                 if jsonpath:
                     schemapath = schemapath.replace("/$ref", "")
-                    if re.search("\[\d+]", schemapath):
+                    if re.search(r"\[\d+]", schemapath):
                         schemapath = schemapath.translate(str.maketrans("", "", "[]"))
                     if not jsonfile:
                         replacepath = jsonpointer.JsonPointer(jsonpath)
