I\'m looking for a decent regex to match a URL (a full URL with scheme, domain, path etc.) I would normally use filter_var but I can\'t in this case as I have to support PHP
!(https?://)?([-_a-z0-9]+\.)*([-_a-z0-9]+)\.([a-z]{2,4})(/?)(.*)!i
I use this regular expression for validating URLs. So far it didn't fail me a single time :)