Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from GNewbury1/fix/ip_validation
Browse files Browse the repository at this point in the history
fix(#6): IP validation regex
  • Loading branch information
vaerh authored Feb 13, 2023
2 parents 3c2df3a + ab74d5a commit b8f41f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routeros/provider_schema_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ var (
"value should be an integer or a time interval: 0..4294967295 (seconds) or 500ms, 2d, 1w")
ValidationAutoYesNo = validation.StringInSlice([]string{"auto", "yes", "no"}, false)
ValidationIpAddress = validation.StringMatch(
regexp.MustCompile(`^$|^!?(\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/([1-2][0-9]|3[0-2]))?)$`),
regexp.MustCompile(`^$|^!?(\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/([0-9]|[1-2][0-9]|3[0-2]))?)$`),
"Allowed addresses should be a CIDR IP address or an empty string",
)
ValidationMacAddress = validation.StringMatch(
Expand Down

0 comments on commit b8f41f9

Please sign in to comment.