I'm trying to validate a string at the beginning with the words "http://" or "https://". Some examples:
http://example.com -> Good
http://www.example.com -> Good
https://example.com -> Good
https://www.example.com -> Good
http:///example.com -> Wrong
http:/www.example.com -> Wrong
https//example.com -> Wrong
I have this regular expression, but it doesn't work well:
str.match(/^(http|https):\/\/?[a-d]/);
...any help please?