Regular Expressions 101

Get a canonical link from html page

Open Workspace
  • PCRE2 (PHP)
  • Match
1

Regular Expression

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

Description

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

Submitted by Anonymous