Reply to Re: preg_match function for URLs

Your name:

Reply:


Posted by Rik on 06/20/07 08:35

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

[Back to original 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

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