Regular Expressions 101

Community Patterns

Matches only word without specific HTML tag around it.

0

Regular Expression
PCRE (PHP <7.3)

/
(?<!<span>)highlighted(?!<\/span>)
/
g

Description

This will match a word that is not wrapper by the a specified HTML element (with a class).

Submitted by Johnny Ji - 8 years ago