Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?!notword)(?:(?!notword).)*yesword
/
gm

Description

Modified from this StackOverflow answer, this Regex matches a word or phrase which is not preceded by another word or phrase

Submitted by anonymous - 3 years ago