I know there are tonns of questions on here to validate a web address with something like this
/^[a-zA-Z]+[:\/\/]+[A-Za-z0-9\-_]+\\.+[A-Za-z0-9\.\/%&=\?\-_]+$/i
The only problem is, not everybody uses the http://
or whatever comes before so i wanted to find a way to use the preg_match()
but not checking for http as a must have but more of a doesn't really matter, i modified it to this but then it rejects the url it it does have http://
in it:
/^[A-Za-z0-9\-_]+\\.+[A-Za-z0-9\.\/%&=\?\-_]+$/i
I was hoping more to validate it on these conditions
- If it has http:// or www then just ignore this
- If the .extension is longer than 9 then reject
- If it contains no full stops
Anybody got an idea, thanks :)