Regular Expressions 101

Community Patterns

UUID v4 with or without dashes

1

Regular Expression
PCRE (PHP <7.3)

/
[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{19}
/
ig

Description

Matches either 01234567-89ab-4def-0123-456789abcdef or 0123456789ab4def0123456789abcdef

Submitted by Semx11 - 8 years ago