mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Fixed regex typo
This commit is contained in:
parent
bbdc7dccba
commit
108db82d1c
@ -523,7 +523,7 @@ def device(request, pk):
|
||||
if re.match('.+[0-9]+$', device.name):
|
||||
# Strip 1 or more trailing digits (e.g. core-switch1)
|
||||
base_name = re.match('(.*?)[0-9]+$', device.name).group(1)
|
||||
elif re.match('.+\d[a-z]+$', device.name.lower()):
|
||||
elif re.match('.+\d[a-z]$', device.name.lower()):
|
||||
# Strip a trailing letter if preceded by a digit (e.g. dist-switch3a -> dist-switch3)
|
||||
base_name = re.match('(.*\d+)[a-z]$', device.name.lower()).group(1)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user