Regular Expressions 101

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
cat(?![^<]*>|[^<>]*<\/mux-video>|[^"'<>]*href\s*=\s*['"][^'"]*['"])
/
gi

Description

A regex to find a searchQuery inside html But not: inside <img> tag inside <mux-video> tag indide href of <a> tag

Submitted by Robair - 2 years ago