|
Posted by John Dunlop on 08/10/06 11:36
Armando Padilla:
> Jerry Stuckle wrote:
>
> > A uri does not include http or https. That is the protocol being used.
> > It could be ftp://, for instance.
> >
> > And this one will fail with some tlds, such as museum.
>
> === UPDATE regex based off of loreto initial post =====
> $uri = 'http://some-domain-name.org';
> if( preg_match(
> '/^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6}'
> .'((:[0-9]{1,5})?\/.*)?$/i' ,$uri))
I think you missed Jerry's point. The ftp scheme name was one example.
What are you going to do about other scheme names? For example,
mailto, which doesn't have a '//' authority part. Are you going to
keep track of new scheme names? What about new TLDs?
--
Jock
Navigation:
[Reply to this message]
|