aspose file tools*
The moose likes Struts and the fly likes Validating domain name with struts validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validating domain name with struts validator" Watch "Validating domain name with struts validator" New topic
Author

Validating domain name with struts validator

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2579

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?



TIA,
- Manish
Durgaprasad Guduguntla
Ranch Hand

Joined: Oct 20, 2003
Posts: 99
Try this:


Thanks,<br />Durgaprasad<br />SCJP1.4, SCWCD1.4, SCBCD1.3,<br />SCEA
 
 
subject: Validating domain name with struts validator