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);
Thursday, August 26, 2010
How to validate IP address using Regular expression
Subscribe to:
Post Comments (Atom)
Azure Storage Account Types
Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...
-
Demo: I was thinking a way to show images before actually uploading them to server. I would say to preview images using javascript. Obv...
-
Demo : I am using asp.net UpdatePanel control to partial page update. As there is no keyup event for the asp.net TextBox control, I add an ...
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