UUID regex pattern

Copy and test a JavaScript regex for UUID values, with examples and a one-click link to the regex tester.

UUID regex pattern

Validate whole value

Use anchors to check whether the complete value matches.

Regex: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

Flags: i

Search in text

Find matching fragments inside a larger block of text.

Regex: \b[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\b

Flags: gi

Examples that match

  • 550e8400-e29b-41d4-a716-446655440000
  • 123e4567-e89b-12d3-a456-426614174000

Examples that do not match

  • 550e8400e29b41d4a716446655440000
  • 550e8400-e29b-91d4-a716-446655440000