Skip to content

Fix/issue 1550 UUID case insensitive - #1551

Merged
nodivbyzero merged 2 commits into
go-playground:masterfrom
leo-jp-edwards:fix/issue-1550-uuid-case-insensitive
Apr 6, 2026
Merged

Fix/issue 1550 UUID case insensitive#1551
nodivbyzero merged 2 commits into
go-playground:masterfrom
leo-jp-edwards:fix/issue-1550-uuid-case-insensitive

Conversation

@leo-jp-edwards

@leo-jp-edwards leo-jp-edwards commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Fixes Or Enhances

Resolves #1550

The uUIDRegexString regex only matched lowercase hex digits (a-f), causing valid UUIDs containing uppercase letters (e.g., 2830923A-E5F5-4178-9700-787586673E0D) to fail validation. UUIDs are case-insensitive per RFC 4122, so both cases should be accepted.

  • Updated uUIDRegexString to accept both uppercase and lowercase hex characters (a-fA-F), aligning it with the behaviour of uUIDRFC4122RegexString.
  • Added a test to cover UUID validation with uppercase hex digits.
  • Manually tested against the example in the issue and the expected behaviour is now observed.

Make sure that you've checked the boxes below before you submit PR:

  • Tests exist or have been written that cover this particular change.

@go-playground/validator-maintainers

@leo-jp-edwards
leo-jp-edwards requested a review from a team as a code owner March 31, 2026 11:46

@deankarn deankarn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@nodivbyzero
nodivbyzero merged commit 0ccc97b into go-playground:master Apr 6, 2026
7 checks passed
bfabio pushed a commit to bfabio/validator that referenced this pull request Apr 8, 2026
## Fixes Or Enhances

Resolves go-playground#1550

The `uUIDRegexString` regex only matched lowercase hex digits (a-f),
causing valid UUIDs containing uppercase letters (e.g.,
`2830923A-E5F5-4178-9700-787586673E0D`) to fail validation. UUIDs are
case-insensitive per RFC 4122, so both cases should be accepted.

- Updated `uUIDRegexString` to accept both uppercase and lowercase hex
characters (a-fA-F), aligning it with the behaviour of
`uUIDRFC4122RegexString`.
- Added a test to cover UUID validation with uppercase hex digits.
- Manually tested against the example in the issue and the expected
behaviour is now observed.

**Make sure that you've checked the boxes below before you submit PR:**
- [x] Tests exist or have been written that cover this particular
change.

@go-playground/validator-maintainers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: UUID validation fails for uppercase UUIDs

3 participants