Answer the question
In order to leave comments, you need to log in
Regular expression for subdomain validation
I searched the Internet for ready-made regular expressions to check the correctness of entering a subdomain.
A lot of them. But something was bothering me. I decided to dig further and found this document: www.ietf.org/rfc/rfc1035 .
I created the following expression for it:
[A-Za-z](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?
[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?
Answer the question
In order to leave comments, you need to log in
Perhaps in itself this restriction was, but one of the subsequent RFCs was canceled.
RFC 1035 Updated by RFC 1101 RFC 1183 RFC 1348 RFC 1876 RFC 1982 RFC 1995 RFC 1996 RFC 2065 RFC 2136 RFC 2181 3425, RFC 3658, RFC 4033, RFC 4034, RFC 4035, RFC 4343, RFC 5936, RFC 5966, RFC 6604.
Please don't take it as an advertisement! Just the first domain that I found that does not fall under your regular season:
2000.ru/
Perfume store
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question