Click here to Skip to main content
15,923,218 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Can any one please help me validate the url by using regular expression
it should validate these type of urls

http://www.codeproject.com

https://www.codeproject.com/quetions

www.codeproject.co.in

it should not allow 4 w's
Posted
Comments
OriginalGriff 19-Aug-13 3:11am    
Reason for my vote of one: Too lazy to use google.
Sergey Alexandrovich Kryukov 19-Aug-13 3:13am    
How such validation can help you? It won't guarantee that the domain is valid.
And the domain name wwww.mysite.com can be valid. Isn't it obvious?
—SA

Try this site. Hope it helps you.

http://regexlib.com/Search.aspx?k=url[^]
 
Share this answer
 
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...

A very quick search using your subject as the search term gave over 1.75 million hits: Google[^]

In future, please try to do at least basic research yourself, and not waste your time or ours.
 
Share this answer
 
Bad idea. Domain name like "wwww.mySite.tld" (yes, with 4 'w') can be valid. To make sure it's so, get some Web hosting, obtain some domain name of your own and create a sub-domain "wwww". It will work, I'll guarantee it.

(By "tld" I mean "top-level domain", such as "com", "org", "net", "edu", etc.)

At the same time, "good" URL like "http://www.mySite.tld" can be invalid. So, this validation would be pretty much useless, even though you could easily perform it, without asking such questions.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900