Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
Hostname validation
Open Workspace
Golang
Match
Created 2017-01-29 01:16
3
Regular Expression
`
(?i)
^
(?:
(
[
a
-
z0
-
9-
]
+
|
\*
)
\.
)?(
[
a
-
z0
-
9-
]
{1,61}
)
\.
(
[
a
-
z0
-
9
]
{2,7}
)
$
`
gm
Description
Validates subdomain, root domain, and wild card domains
Submitted by
AnonymousDapper