From c1d147cc0246f15fbdd8a7d4484e2d4db7d1d285 Mon Sep 17 00:00:00 2001 From: Patrick Ogenstad Date: Thu, 11 Jul 2024 13:12:25 +0200 Subject: [PATCH] Regex updates for Python 3.12 --- docs/howto/filtering_deep_dive.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/howto/filtering_deep_dive.ipynb b/docs/howto/filtering_deep_dive.ipynb index 389d55b1..1a7826b2 100644 --- a/docs/howto/filtering_deep_dive.ipynb +++ b/docs/howto/filtering_deep_dive.ipynb @@ -2056,7 +2056,7 @@ " :return bool: True if it matches, False if it doesn't match\n", " \"\"\"\n", " # Perform regex match on host name and return boolean\n", - " if re.match(\".+\\-[0-9][2,4,6,8,0].+\", host.name):\n", + " if re.match(r\".*-\\d[24680].*\", host.name):\n", " return True\n", " else:\n", " return False\n", @@ -2074,7 +2074,7 @@ " :return bool: True if it matches, False if it doesn't match\n", " \"\"\"\n", " # Perform regex match on host name and return boolean\n", - " if re.match(\"\\w{3}\\-\\w+\\-\\d{2}.\\w{3}.norn.local\", host.name):\n", + " if re.match(r\"\\w{3}-\\w+-\\d{2}\\.\\w{3}\\.norn\\.local\", host.name):\n", " return True\n", " else:\n", " return False\n", @@ -2092,7 +2092,7 @@ " :return bool: True if does not match, False if it matches the convention\n", " \"\"\"\n", " # Perform regex match on host name and return boolean\n", - " if re.match(\"\\w{3}\\-\\w+\\-\\d{2}.\\w{3}.norn.local\", host.name):\n", + " if re.match(r\"\\w{3}-\\w+-\\d{2}\\.\\w{3}\\.norn\\.local\", host.name):\n", " return False\n", " else:\n", " return True\n",