better regex for subnet

This commit is contained in:
Matt Hill
2025-11-05 12:48:56 -07:00
parent e0995a63ca
commit 2c05e6129c

View File

@@ -65,7 +65,7 @@ export class SubnetsAdd {
[
Validators.required,
Validators.pattern(
'^(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)/(?:[12]?\\d|3[0-2])$',
'^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)/(?:[0-9]|1\\d|2[0-4])$',
),
],
],