Click here to Skip to main content
15,913,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is the regex i am using:
var regex = /(^(?:http(s)?\:\/\/www\.)(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)(?:.com|.in|.org)$/;


it is validating http(s),www and the (.com/.in/.org) part. but i want only one occurrence of these three. what shud i do?
Posted
Comments
[no name] 12-Mar-15 2:55am    
which one you want ?

1 solution

 
Share this answer
 
Comments
dirtyshooter 12-Mar-15 3:15am    
dint solve my problem. i want to block double occurrence of (http)
[no name] 12-Mar-15 4:29am    
Try this.
http://www.regular-expressions.info/duplicatelines.html
http://stackoverflow.com/questions/8206269/how-to-remove-http-from-a-url-in-javascript

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