Regular Expressions 101

Community Patterns

1...34567...881

find all link(<a>) tags expect your links in href attribute

11

Regular Expression
ECMAScript (JavaScript)

/
<(a+) (?!(?:href=(["|']+)([http:\/\/])*link\.com([\/])?(.*?)["|'])) *[^>]*>(.*?)[^>]>
/
gm

Description

<a href="yourlink.com">YourLink</a> - not found <a href="anotherlink.com">AnotherLink</a> - found

Submitted by KoT - 9 years ago