Re: Regex help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



kjohnson@xxxxxxxxxxx wrote:
> OK, this is off-topic like every other "regex help" post, but I know some
> of you enjoy these puzzles :)
>
> I need a validation regex that will "pass" a string. The string can be no
> longer than some maximum length, and it can contain any characters except
> two consecutive ampersands (&) anywhere in the string.

$text = $_REQUEST['text'];
if (strlne($text) < 42 && !strstr($text, '&&')){
  //kosher
}
else{
  trigger_error("Invalid input", E_USER_ERROR);
}

Oh, wait, that's not Regex.  Oh well.  Too bad.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux