Common use cases
- ✓API request validation
- ✓Database identifier checks
- ✓Test-fixture verification
Validate UUID version 4 strings with a pattern that checks the 8-4-4-4-12 hexadecimal layout, the version-4 nibble, and the RFC variant nibble. Use the live examples below before copying the pattern into JavaScript or another compatible regex engine.
^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Flags: i
Enter one value per line. Each line is tested against the whole-string pattern using the browser JavaScript RegExp engine.
550e8400-e29b-41d4-a716-4466554400006ba7b810-9dad-4d1d-80b4-00c04fd430c8A987FBC9-4BED-4078-8F07-9141BA07C9F3550e8400-e29b-11d4-a716-446655440000550e8400-e29b-41d4-7716-446655440000550e8400e29b41d4a716446655440000For UUID v4, use a whole-string pattern that fixes the third group to version 4 and restricts the first character of the fourth group to 8, 9, a, or b. A generic UUID-shape regex is not enough when the version matters.
550e8400-e29b-41d4-a716-4466554400006ba7b810-9dad-4d1d-80b4-00c04fd430c8A987FBC9-4BED-4078-8F07-9141BA07C9F3550e8400-e29b-11d4-a716-446655440000550e8400-e29b-41d4-7716-446655440000550e8400e29b41d4a716446655440000The first character of the third group is fixed to 4, which identifies version 4. The first character of the fourth group is restricted to 8, 9, a, or b for the standard variant.
Usually no. Hexadecimal UUID text is commonly written in lowercase, but uppercase A–F is also a normal representation, so this pattern uses the case-insensitive flag.
No. It only checks the string format and v4 markers. Uniqueness depends on how the UUID was generated and used.
Move from a live JavaScript regex test to capture-group inspection, flag behavior, literal escaping, focused pattern references, and debugging guides without treating each regex task as an isolated page.