Skip to content

Commit

Permalink
checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
jctanner committed Oct 5, 2023
1 parent fea4f9e commit 451a07d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev/scripts.community/cleanup_namespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def do_cleanup():
prefix, number = strip_number_from_string(ns_name)
#print(f'{prefix} {number}')
if number is None:
if prefix not in ns_map:
ns_map[prefix] = [prefix]
continue
if prefix not in ns_map:
ns_map[prefix] = []
Expand Down
12 changes: 12 additions & 0 deletions dev/scripts.community/testme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import re

def strip_number_from_string(input_string):
#match = re.search(r'(\D+)(\d+)$', input_string)
#match = re.search(r'([\w\d_]*)(\d+)$', input_string)
match = re.search(r'([\w_]*[A-Za-z_])(\d+)$', input_string)
if match:
prefix = match.group(1)
number = match.group(2)
return prefix, int(number)
else:
return input_string, None

0 comments on commit 451a07d

Please sign in to comment.