Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Regular Expression For Validating URl with IP Address
2 replies. Latest Post by tanmoy.r on July 3, 2009.
(0)
Sriram R...
Member
11 points
51 Posts
07-02-2009 10:29 PM |
Hi Guys,
I am in need of a Regular Expression Validator with which i can Validate a URl. I am using the Silverlight Validator. My Input Will be
Example:
http://172.16.32.111/sample/sample.html .......
I need to Just Check if the http:// and the IP Address are in a Correct format.. Can somebody Give me a Regular Expression for that.
Any Help is greatly appreciated.
Thanks,
Sriram
TomBeeby
Participant
1151 points
188 Posts
07-02-2009 11:35 PM |
a very simplistic example:
(?:https?|ftp)://[-a-zA-Z0-9.]+(:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9][0-9]|6[0-4][0-9][0-9][0-9]|\d{2,4}|[1-9]))?
tanmoy.r
Contributor
3594 points
710 Posts
07-03-2009 12:03 AM |
You can use what Tom has given and you might want to take a look at
http://regexlib.com/Search.aspx?k=url to get many other regex patterns. This site will help you quickly find many regular expressions in future.