Regular Expressions 101

Community Patterns

Capture Anchor Tag urls (http/https)

1

Regular Expression
ECMAScript (JavaScript)

/
href=["'](https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s"']{2,}|(?!ftp:\/\/)[^\s]+\.[^\s'"]{2,})
/
g

Description

Capture all anchor tags url with http and https, excluding ftp links

Submitted by koder5 - 8 years ago