Possible Duplicate:
Regular expression to match hostname or IP Address?
I need to validate a string that should contain DNS. Which regex is appropiate?
Possible Duplicate:
Regular expression to match hostname or IP Address?
I need to validate a string that should contain DNS. Which regex is appropiate?
It seems someone asks this question yet, try to search before asking see this
(?=^.{1,254}$)(^(?:(?!\d+\.|-)[a-zA-Z0-9_\-]{1,63}(?<!-)\.?)+(?:[a-zA-Z]{2,})$)