Regular Expressions 101

Community Patterns

Find location of Open Search Description XML file

1

Regular Expression
PCRE (PHP <7.3)

/
<link(?=[^<>]*?opensearch)(?:[^h]+|h(?!ref))*+href=["']?\K([^<>'"\s]+(?:\/(?!>)|\b))(?=[^<>]*>)
/
igmx

Description

Find the location (HREF value) of the Open Search Description link tag.

Submitted by Evander Consus - 8 years ago