Posted by John Dunlop on 05/15/06 20:34
Rik:
> if(preg_match('"^(https?://|ftp://|mailto:|\.{0,2}/|smb://|file://|s?news:|l
> dap(i|s)?:|gopher:|nntp:|telnet:|mms:|ssh:)"si', $url)<1) $url =
> 'http://'.$url;
>
> I'm still forgetting a lot of other possibilities though...
Forget about particular schemes and match scheme names (plus colon)
in general:
`^[a-z][a-z\d+.-]+:`i
http://www.ietf.org/rfc/rfc3986.txt :3.1
--
Jock
[Back to original message]
|