|
|
|
|
|
|
Re: Create automatic links with www. only [message #15086 is a reply to message #15076] |
Mon, 01 December 2003 22:32   |
melvyn
 Messages: 7 Registered: December 2003 Location: Hilversum, The Netherland...
Karma: 0
|
Junior Member |
|
|
_ aren't allowed in domains (long discussion about '_' being used in RR records) but '-' are
[^\s] = \S
[A-Za-z] with /i is redundant
www.country.domain.tld isn't recognized
tld needs a minimum of 2 and I think a max of 6 (.museum) which can be used as an anchor point.
resulting in:
$str = preg_replace('!(^|\s)(www\.[A-Za-z0-9.-]+\.[A-Za-z]{2,6})!','\1http://\2', $str);
Melvyn
[Updated on: Mon, 01 December 2003 22:33] Report message to a moderator
|
|
|
|
|
|