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?