Duplicate: PHP validation/regex for URL
My goal is create a PHP regex for website name. The regex is for a lead gathering form and should accept any legit kind of website name syntax that someone might enter. After an exhaustive search, I'm surprised that I can't find one out there.
Here are the regex matches that I'm looking for:
- somewebsite.com
- http://somewebsite.com
- http://www.somewebsite.com
AND, it should also match:
- any of the above with a trailing backslash, such as: somewebsite.com/
- subdomains