LogoReturn to Home RegEx
Integrations
All integrations
AWS API
AWS Lambda
DynamoDB
Oracle
Redshift
Snowflake
GraphQL
Supabase
Twilio
Azure Blob Storage
Slack
SendGrid
Generic HTTP API
AWS S3
Stripe
Microsoft SQL
Salesforce
PostgreSQL
MySQL
MongoDB
HubSpot
Google Sheets
Google BigQuery
Firebase
Airtable
Integrations
About UI Bakery
Log in
Request UI Bakery demo
RegEx library
Email regex
Phone number regex
IP address regex
Date regex
URL regex
Numbers only regex (digits only)
UUID regex
Regex match words
ZIP code regex
GUID regex
Password regex
HTML regex (regex remove html tags)
SSN regex
XML regex
Mac address regex
Street address regex

UUID regex

UUID is a 128-bit label used for identifications in computer systems.

Discover UI Bakery – an intuitive visual internal tools builder. Try it now!
No items found.
JavaScript
Python
Java
C#
PHP

UUID regex

Below is a simple UUID regular expression that will work most of the time:

/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i
Test it!
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i

True

False

Enter a text in the input above to see the result

Example code in Javascript:

var uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
// Validate UUID
uuidRegex.test('123e4567-e89b-12d3-a456-426614174000'); // Returns true

// Extract UUID from string
var uuidRegexG = /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/g;
'The UUID 123e4567-e89b-12d3-a456-426614174000 for node Node 01 is not unique.'.match(uuidRegexG); // returns ['123e4567-e89b-12d3-a456-426614174000']
Test it!

True

False

Enter a text in the input above to see the result

Test it!

True

False

Enter a text in the input above to see the result

Create an internal tool with UI Bakery

Discover UI Bakery – an intuitive visual internal tools builder.

Try it now