Re: Eregi error

From: Date: Thu, 01 Mar 2007 22:47:16 +0000
Subject: Re: Eregi error
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-249685@lists.php.net to get a copy of this message
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?

« previous php.general (#249685) next »