Answer the question
In order to leave comments, you need to log in
Regular expression for domain validation with punycode support?
I'm trying to write a regexp for strict domain validation with support for IDN encoding (xn--).
At the moment, "as it should" only the TLD check works for me:
[az]{2,6}$|(xn--)?[a-z0-9]{4,32}i.e. checking for regular az, then for punycode (I have omitted the listing of all registered zones so far for simplicity)
-aaaamust be true:
aaaa-
aa--a
--aaa
aaa--
.aaaa
aaaa.
..aaa
aa..a
xn--aaaaaaI googled the entire Internet, everything is obvious from the manuals, but I try to build it into the big picture, and nothing works in the end.
xn--a-aa.a
aa.xn--aa
a.xn--aa.a
xn--a-aa-a
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question