Validating a Text Box

A

aj

Jordan you can use regular expression (Namespace:
System.Text.RegularExpressions) for validating the IP
address in the textbox.

Regular Expression to validate Web address:
^(http|https|ftp)\://(((((([0-1])?([0-9])?[0-9])|(2[0-4]
[0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4]
[0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4]
[0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4]
[0-9])|(2[0-5][0-5]))))|((([a-z0-9\-])+\.)+([a-z]{2}\.[a-
z]{2}|[a-z]{2,4})))$

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top