You are here: Re: This works fine, but it is kinda complicated « All PHP « IT news, forums, messages
Re: This works fine, but it is kinda complicated

Posted by Don Salad on 07/11/06 14:55

"Perry Malen" <p...@nospamformethankyou.com> wrote:

> No, we don't. I took issue not with *why* you tried to check the url-ness,
> but with how. Your regexp:
>
> > /\[url]([a-zA-Z]+:\/\/[0-9a-zA-Z._\-\/\?\&\+]+)/
>
> says, in so many words: Following the [url] tag, match one or more
> characters a-z (case insensitive) followed by a colon followed by two
> slashes followed by one or more 'url-legal' characters. That's it. According
> to this regexp, 'mydog://hasfleas' is a valid url. Obviously, your good
> intentions are not well served by this particular pattern. You should either
> fix the regexp or just drop it altogether and trust that whatever follows
> the [url] tag is, in fact, a url.

You could have a host named 'hasfleas' on your local network, and some
customized 'mydog' protocol.

'mydog://hasfleas' *is* a syntactically valid URL. It just doesn't
work in most cases.

Thanks,
Don

 

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

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