Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(^|\s)(https?:\/\/(www\.)?|www\.)[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+(\/[a-zA-Z0-9-._~!$&'()*+,;=:@\/]*)*\/?(?=$|\s|[^\w])
/
g

Description

This regex will find domain inside of strings

Submitted by anonymous - 2 years ago