Skip to content

Commit

Permalink
Fix ULID should case-insensitive (#1258)
Browse files Browse the repository at this point in the history
## Fixes ULID should case-insensitive

@go-playground/validator-maintainers
  • Loading branch information
akayj committed Apr 30, 2024
1 parent a0f74b0 commit 21b0b9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion regexes.go
Expand Up @@ -31,7 +31,7 @@ const (
uUID4RFC4122RegexString = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
uUID5RFC4122RegexString = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-5[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
uUIDRFC4122RegexString = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
uLIDRegexString = "^[A-HJKMNP-TV-Z0-9]{26}$"
uLIDRegexString = "^(?i)[A-HJKMNP-TV-Z0-9]{26}$"
md4RegexString = "^[0-9a-f]{32}$"
md5RegexString = "^[0-9a-f]{32}$"
sha256RegexString = "^[0-9a-f]{64}$"
Expand Down
2 changes: 1 addition & 1 deletion validator_test.go
Expand Up @@ -4338,7 +4338,7 @@ func TestULIDValidation(t *testing.T) {
}{
{"", false},
{"01BX5ZZKBKACT-V9WEVGEMMVRZ", false},
{"01bx5zzkbkactav9wevgemmvrz", false},
{"01bx5zzkbkactav9wevgemmvrz", true},
{"a987Fbc9-4bed-3078-cf07-9141ba07c9f3xxx", false},
{"01BX5ZZKBKACTAV9WEVGEMMVRZABC", false},
{"01BX5ZZKBKACTAV9WEVGEMMVRZABC", false},
Expand Down

0 comments on commit 21b0b9f

Please sign in to comment.