Regular Expressions 101

Community Patterns

1...34567...901

Community Library Entry

4

Regular Expression
PCRE (PHP <7.3)

/
(?:.*?(Constr1)+){3}.*?((Constr1)+)
/
s

Description

Match nth occurence of the patterns in the inner parenthesis. Put nth that you want to match in the curly braces (here, {3}).

Submitted by Alex Hall - 10 years ago