regex for uuid
match a hyphen-delimited uuid
^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$
Regex Flags
global match
?
ignore case
?
multiline
?
dotAll
?
unicode
?
sticky
?
123e4567-e89b-12d3-a456-426655440000
c73bcdcc-2669-4bf6-81d3-e4ae73fb11fd
C73BCDCC-2669-4Bf6-81d3-E4AE73FB11FD
c73bcdcc-2669-4bf6-81d3-e4an73fb11fd
c73bcdcc26694bf681d3e4ae73fb11fd
definitely-not-a-uuid
Hyphen-separated universally unique identifier (UUID)
This expression can be used to find or validate a UUID. UUIDs are often used to uniquely identify information in computer systems. A UUID is a 128-bit number represented, textually, in 16 octets as 32 hexadecimal (base-16) digits.
These 32 digits are displayed in 5 groups separated by hyphens, in the form 8-4-4-4-12, for a total of 36 characters. You may edit the regex to your liking for removing hyphens.
Cheatsheet
expr | usage |
---|---|
/\d/ | matches any digit |
/[a-zA-Z0-9]/ | matches all lowercase, uppercase letters and numbers |
/(hello){4}/ | matches "hellohellohellohello" |
/^/ | matches beginning of a line |
/$/ | matches end of a line |
iHateRegex
by
geon