You are here: Re: preg_match function for URLs « PHP Programming Language « IT news, forums, messages
Re: preg_match function for URLs

Posted by Phil Latio on 06/21/07 01:11

"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:op.tt7ot5p2qnv3q9@metallium...
> On Wed, 20 Jun 2007 05:47:27 +0200, Phil Latio
> <phil.latio@f-in-stupid.co.uk> wrote:
>
>> Below is a function I've written for validating URLs.
>> if(preg_match("/^[http://www.|www.][\S]+$/", $string))
> --------------------------^
>
>> However I keep getting the error message:
>> Warning: preg_match() [function.preg-match]: Unknown modifier '/'
>>
>> What have I obviously missed?
>
> That if you start a regex with '/', any '/' will end it, and the rest od
> the string has to be interpreted as modifiers. You can use anything as a
> modifier, so just use another character.
>
>
> --
> Rik Wasmus

Thanks for that. I am not really familiar regular expressions yet but well
written ones seem quite useful.

Cheers

Phil

 

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

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