Regular Expressions 101

Community Patterns

Url regex that capture the domain of the URL

1

Regular Expression
ECMAScript (JavaScript)

/
(?:http|https):\/\/((?:[\w-]+)(?:\.[\w-]+)+)(?:[\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?
/
gm

Description

https://developer.mozilla.org/es/ Url regex that capture the domain of the URL

Submitted by anonymous - 8 years ago