Re: Eregi error

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

 



On Wed, February 28, 2007 9:08 pm, Brad wrote:
> I have been having some trouble with the "eregi" function. I have the
> following piece of code in my application:
>
>     function standard_input($input, $min=0, $max=50){
>         if (strlen($input) <= $max and strlen($input) >= $min ) {
>             $pattern = '^[a-z0-9\!\_ \.- ,/]*$';

It means that the bit that hs .- , above makes ZERO sense, because ,
comes before . in ASCII, so you can't do that range you just tried to
do.

Of course, you weren't actually trying to do a RANGE, but when you
tacked ' ,/' onto your pattern, you weren't paying attention to the
fact that - has to be at the very end, or very beginning, or (maybe?)
escaped so that EREG knows it's not a RANGE you are defining, but a
single character in the character set.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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