Regex: Validates MS FQDNs. 1) Entire fqdn less than 255 chars. 2) Host and domain names may cont...
Posted by: RegexLib.com - Recent Patterns,
on 11 Jan 2006 |
View original | Bookmarked: 0 time(s)
Regex:
Validates MS FQDNs. 1) Entire fqdn less than 255 chars. 2) Host and domain names may contain an underscore. 3) 1st char can be a number. 4) No part can be all numbers. 5) Allows any TLD
Works in C#. Based on Remi Sabourin's regex
*********************************************
(?=^.{1,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)