Domain Name Validation Regular Expression without Recursive Reference

/^

(

[a-z] |        # One-letter domain name

[a-z] [a-z 0-9] |        # Two-letters domain name

[a-z] ([a-z 0-9 \-]){1,61} [a-z 0-9]        # More-letters domain name

)

(

\.

(

[a-z] |        # One-letter domain name

[a-z] [a-z 0-9] |        # Two-letters domain name

[a-z] ([a-z 0-9 \-]){1,61} [a-z 0-9]        # More-letters domain name

)

)*?        # More labels

\.?        # Root domain name

$/Dix