I want to validate a url that is with or without http.
i tried ^http(s{0,1})://[a-zA-Z0-9_/\\-\\.]+\\.([A-Za-z/]{2,5})[a-zA-Z0-9_/\\&\\?\\=\\-\\.\\~\\%]*
But this is matches http://google.com but not www.google.com.
i want a regex that matches http://www.google.com too.
Thanks
^(?:https?://)? ... the rest of your regex?:means do not capture group?quantifier minification (match if exists, if not – omit it)P.S. I’m not sure if
quantifier minificationmakes sense to english native speakers, this is a rough translation from russian 🙂 Hopefully, if I’m mistaken, somebody understands what I meant and could fix me.