Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
\b\w[-.\w]+\.(com|org|net)\b
/
gm
Input 1
1
New
Test strings hello.com hello1.com 1hello.com hello-1.com hello-hi1.com 1hello-hi.com h3ll0.com also matches hello_1.com ---.com 1234.org -.net a.net abc.comical www.company.com this is a sentance about net-working.networking is bla bla bla will not match other domains hello.co.uk hello.co subdomain.hello.com correctly grabs the domain for abc.com&foobar abc.com/foobar abc.com?foobar
Substitution
Test strings hello.com hello1.com 1hello.com hello-1.com hello-hi1.com 1hello-hi.com h3ll0.com also matches hello_1.com ---.com 1234.org -.net a.net abc.comical www.company.com this is a sentance about net-working.networking is bla bla bla will not match other domains hello.co.uk hello.co subdomain.hello.com correctly grabs the domain for abc.com&foobar abc.com/foobar abc.com?foobar