Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
rel=['"](?:shortcut )?icon['"] href=['"]([^?'"]+)[?'"]
/
g

Description

Looks for "shortcut icon" or "icon" in a link rel and will strip query strings.

Submitted by EcoTechie - 3 years ago