The GUID Regex Python Validator is designed to help developers and testers confirm that GUIDs (Globally Unique Identifiers) match proper formatting. Perfect for validating API tokens, resource IDs, or database keys, this tool is essential for quality checks. You can pair it with the UUID Regex Python Validator or the Mac Address Regex Python Validator to build solid validation flows in your Python projects.
[A-Z]
: uppercase letters[a-z]
: lowercase letters[0-9]
: digits\.
: a literal dot+
: one or more of the preceding*
: zero or more of the preceding?
: optional (zero or one)^
: start of string$
: end of string
Test your APIs today!
Write in plain English — Qodex turns it into secure, ready-to-run tests.
Regular Expression - Documentation
What Is a GUID?
A GUID is a 128-bit unique identifier often used to label resources like users, sessions, or records. It appears as a string in this format:
Where each x is a hexadecimal digit (0-9, a-f, or A-F). While GUIDs and UUIDs are functionally similar, GUIDs are more common in Microsoft-based systems.
Regex Pattern for GUID in Python
Here’s a regex pattern that accurately validates a standard GUID:
This ensures:
8 digits at the beginning
Followed by three groups of 4 digits (hyphen-separated)
Ends with 12 hex digits
Python Example to Validate GUID
Use Cases
Database Record IDs: Use GUIDs as primary keys for distributed systems.
Authentication Tokens: Validate GUIDs passed via API headers or query strings.
Data Synchronization: Match GUIDs in local and remote storage to ensure consistency.
Debugging Tools: Use it with the IP Address Regex Python Validator to monitor network-based identifiers.
Pro Tips
Always sanitize GUID inputs—especially from client-side sources.
Strip leading/trailing whitespaces before validation.
Combine it with the Date Regex Python Validator when working with time-stamped identifiers.
Use lowercase GUIDs in systems where case doesn’t matter to maintain consistency.