Regular Expressions 101

Community Patterns

Match word or phrase not preceded by another word or phrase

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 - 2 years ago