Regular Expressions 101

Community Patterns

Lazy/greedy and non capturing group

0

Regular Expression
PCRE (PHP <7.3)

/
(?<First>\w+?) (?# First word UNGREEDY) (?> (?# Second group - see it is optional) (?>_) (?# But if it exists, must start with "_" NON CAPTURING GROUP ) (?<Second>\w+) (?# Snd then there should be a word - at least one char) )* (?# remember - the group is optional) \b (?# All the puttern must finish with word boundary)
/
gmx

Description

no description available

Submitted by anonymous - 4 years ago