How do I make a specific regular expression for PHP that searches for "http" first and if its not there to search "www.", if its also not there search .TLD's
I need to grab domain names from a single line of text, with in mind working with only dyslectic
people. The dots can sometimes be replaced with commas. Or they somehow skip a dot in the domain name.
So my idea to solve this is;
1: search for http (if not found, go to approach 2)
2: search for www (if not found, go to approach 3)
3: search for all available TLD in this list http://data.iana.org/TLD/tlds-alpha-by-domain.txt
4: FAIL, I did my best.
I only need to return, subdomain.domain.tld and if there's a path a path.