Hey all,
I'm looking for a regular expression to use with PHP (either ereg or preg_match) to validate a URL. I looked at regexlib.com and didn't find one that would work.
The catch is that I need one that will allow URL's with multiple subdomains (i.e. http://www.fs.fed.us) and for other wacky government stuff like that (aphi.usda.gov, eglin.af.mil, etc). It of course needs to allow for directories and files after the domain part too (sub.sub.domain.com/directory/anotherdirectory/file.php, domain.com/directory, etc.)
Does anybody have a regular expression that would do the trick or know where I could find one?
Thanks!