string exp = @" ^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\. (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"; string ipAddress = "127.0.0.1"; bool isMatch = Regex.IsMatch(ipAddress,exp);
3 comments:
Hi,
Please let me know the regular expression which validates IP address and excludes localhost
Thank you
Given regular expression works, I have a requirement to exclude local host. Please let me know how to do that
Given regular expression works. I have a requirement to exclude local host. Please let me know how to do that.
Post a Comment