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
/
(?=^.{1,254}$)(^(?>(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)
/
gm
Input 1
1
New
Match: host.domain.com _host.domain.com 1host-2._ldap.domain.com Non-Matches: 33.domain.com host..com this_really_long._fully_qualified_domain_name._contains_257_characters_w