Re: [PHP] Eregi error

2007-03-01 Thread Nicholas Yim
Hello Brad, suggest to use preg_* instead of ereg_* extension is useless Best regards, === At 2007-03-01, 11:12:52 you wrote: === Hey all, I have been having some trouble with the eregi function. I have the following piece of code in my application: function

Re: [PHP] Eregi error

2007-03-01 Thread M.Sokolewicz
I agree with the first part, that it is in many cases better to use the Perl Compatible Regular Expressions (PCRE, preg_*) than the POSIX compatible ones (ereg[i]_*). However, I don't quite get what you mean by extension is useless ? What extension...?? and why would it be useless? (useless in

Re: [PHP] Eregi error

2007-03-01 Thread Myron Turner
M.Sokolewicz wrote: Hey all, 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\!\_

Re: [PHP] Eregi error

2007-03-01 Thread Roberto Mansfield
Myron Turner wrote: M.Sokolewicz wrote: $pattern = '^[a-z0-9\!\_ \.- ,/]*$'; if(!eregi($pattern, $input)){ the problem is that the hyphen is interpreted as regex range operator: [a-z0-9\!\_ \.- ,/] Rewrite this as

Re: [PHP] Eregi error

2007-03-01 Thread Richard Lynch
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 ) {

Re: [PHP] Eregi error

2007-03-01 Thread Myron Turner
Roberto Mansfield wrote: Myron Turner wrote: M.Sokolewicz wrote: $pattern = '^[a-z0-9\!\_ \.- ,/]*$'; if(!eregi($pattern, $input)){ the problem is that the hyphen is interpreted as regex range operator:

Re: [PHP] Eregi error

2007-03-01 Thread Richard Lynch
On Thu, March 1, 2007 6:14 pm, Myron Turner wrote: Roberto Mansfield wrote: Myron Turner wrote: M.Sokolewicz wrote: $pattern = '^[a-z0-9\!\_ \.- ,/]*$'; if(!eregi($pattern, $input)){ the problem is that the hyphen is interpreted as regex range operator:

RE: [PHP] Eregi error

2007-02-28 Thread Peter Lauri
Not sure, but I don't think you should escape all those characters inside of the character class. I might be wrong. However, that might not have anything to do with the error. But I do think you need to escape the / in the end... And the - you should have in the beginning of the character class,