Regular Expressions 101

Community Patterns

1...56789...402

Get a canonical link from html page

1

Regular Expression
PCRE2 (PHP >=7.3)

/
<link rel="canonical" href="(.*?)">
/
gm

Description

Gets the canonical link from a html page provided it has one

Submitted by anonymous - 5 months ago