|
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]
|