I am using php.
I have these lines of text in textbox:
Technology, Sciene
Domains
www.abc.de
http://cdf.com
something.co.uk
Health, Wellness
Domains
wellness.com
wellbeing.de
feelgood.ca
feelawesome.de.vu
My php script is getting each line into an array which I loop through later. What I want: delete every line that is not a domain or link.`
Note: My domains do not necessarily come with a http
or www.
What code I came up with so far:
preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
I would add an "http://"
if there is non already and then run the code above...
But it doesn't work.
The Line "Domain"
still gets recognized as a valid domain.
Any Idea?