Can anyone help me write proper validation for validating a domain name (only SLD), I am trying few things wit RegEx but guess I am not very comfortable with regular expressions now.
The conditions for valid domain mae are as follow -
* Domain Name must be composed of the letters a through z, the numbers 0 through 9, and the hyphen (-) character. * The Domain Name must not begin or end with the hyphen character. * The Domain Name must not contain spaces. * The Domain Name must not contain special characters other than the hyphen character. * The Domain Name must contain 2 to 63 characters, inclusive. * Domain Names are not case sensitive.
What should I put in this mask now considering the conditions mentioned above?