Regex for UUID
/\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/gi
Matches
Examples
Note
Checks the version digit (1–8) and the RFC 9562 variant bits (8, 9, a or b). Drop those two checks to accept any 8-4-4-4-12 hex string.
Matches in the example
"550e8400-e29b-41d4-a716-446655440000""01890a5d-ac96-774b-bcce-b302099a8057"
Token by token
\ba word boundary[0-9a-f]{8}one of: “0” to “9” or “a” to “f”, exactly 8 times-the character “-”[0-9a-f]{4}one of: “0” to “9” or “a” to “f”, exactly 4 times-the character “-”[1-8]one of: “1” to “8”[0-9a-f]{3}one of: “0” to “9” or “a” to “f”, exactly 3 times-the character “-”[89ab]one of: “8”, “9”, “a” or “b”[0-9a-f]{3}one of: “0” to “9” or “a” to “f”, exactly 3 times-the character “-”[0-9a-f]{12}one of: “0” to “9” or “a” to “f”, exactly 12 times\ba word boundary
Other patterns
- Email address
- URL
- IPv4 address
- UUID
- Hex color
- Date (YYYY-MM-DD)
- Time (24-hour)
- US phone number
- Phone number (E.164)
- US ZIP code
- Credit card number
- URL slug
- Username
- Strong password
- HTML tag
- Semantic version
- MAC address
- JSON Web Token
- Hashtag
- @mention
- Number
- Leading and trailing whitespace
- Repeated word
- Blank lines
- Markdown link
- Quoted string
- Domain name
- File extension
- Base64
- Trailing comma