Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?<!XXY)(?<=Y)\w(?=Y)(?!YYXX)
/
gm

Description

An example of lookahead and lookbehind, both negative and positive. Allows to limit matches within specified limits without capture groups

Submitted by CAMOKPYT - 2 years ago