Regular Expressions 101

Community Patterns

regex to format

0

Regular Expression
PCRE (PHP <7.3)

/
\(\?P<(\w+)> # named group (name captured as group 1): (?P<name> ( # matching pattern as group (2) in form: b(R1)a1...(R2)a2 [^)(]*+ # `b` (before) part - any not `)(` characters (?: # non capturing group for repeated `(R)a` \((?2)\) # `R` - reference to group 2 for possible nested braces [^)(]*+ # 'a' (after) part - any not `)(` characters )* # `(R)a` repetition is optional ) # end the group 2 \) # end of the named group to match
/
gx

Description

no description available

Submitted by anonymous - 4 years ago