Filter ahrefs links from HTML

With this neat little regex.

1 min.

A quick & dirty way to filter all links from a given piece of HTML code. Does not filter attributes.

<\/*?(?![^>]*?\b(?:a)\b)[^>]*?>

Another one also filters linktext:

(?i)<a\shref=\"([^>]+)\">(.+?)</a>

Replace it with:

$1    $2
→ Call to action ←

Sounds interesting?

Then let's make the virtual gap between us a little bit shorter!