You are here: Re: URL Validate « PHP Programming Language « IT news, forums, messages
Re: URL Validate

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация