191
rated 0 times
[
194]
[
3]
/ answers: 1 / hits: 41765
/ 14 Years ago, thu, november 25, 2010, 12:00:00
I'm looking for a regex that accept urls like these:
http://www.example.com
www.example.com
This is what I have so far, but it regex doesn't match URLs without http://
or https://
, or ftp://
:
regexp = /(ftp|http|https)://(w+:{0,1}w*@)?(S+)(:[0-9]+)?(/|/([w#!:.?+=&%@!-/]))?/;
How can I make the protocol optional?
More From » regex