Skip to content

Commit

Permalink
Regex updates for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ogenstad committed Jul 11, 2024
1 parent 26ca6e2 commit c1d147c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/howto/filtering_deep_dive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit c1d147c

Please sign in to comment.