Skip to main content

Microsoft Silverlight

Answered Question Regular Expression For Validating URl with IP AddressRSS Feed

(0)

Sriram Ramaswami
Sriram R...

Member

Member

11 points

51 Posts

Regular Expression For Validating URl with IP Address

 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
TomBeeby

Participant

Participant

1151 points

188 Posts

Answered Question

Re: Regular Expression For Validating URl with IP Address

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
tanmoy.r

Contributor

Contributor

3594 points

710 Posts

Answered Question

Re: Re: Regular Expression For Validating URl with IP Address

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.

Please Mark as Answer if this helps you.
Thanks n Regards
~Tanmoy
Blog: http://anothersilverlight.blogspot.com/
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities