Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(?<Bracket>\{)?[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}(?(Bracket)\}|)$
/
gm

Description

Pattern for a guid with optional brackets: 12345678-1234-1234-1234-123456789012 or {12345678-1234-1234-1234-123456789012}.

Submitted by anonymous - 5 years ago