I have this tags, and I want to replace the content of a tag (link-one) with the content of another tag (link two). So, to extract the content of a tag and replace it in another tag. For example
<link rel="canonical" href="https://mywebsite.com/link-one.html" />
<a href="/en/link-two.html">
The output should be:
<link rel="canonical" href="https:/mywebsite.com/link-two.html" />
I made a regex, that almost works, but it must be a little bit improved..
Search:
(<link rel="canonical" href=").*?(" \/>)(.*?)(<a href="/en/(.*?)">)
Replace by:
\1\5\3\4
(check .Matches newline
)