Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
jform\[([\w\-]+)\]\[?([\w\-]+)?\]?
/
gm

Description

Matches all alphanumeric (\w), underscore and dash (-) that is included in square brackets ([]). The result gives two groups that can be used with $1 and $2.

Submitted by anonymous - 5 years ago