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 rege

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: [a-z0-9\!

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

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 sta

RE: [PHP] Eregi error

2007-02-28 Thread Peter Lauri
iling Subject: [PHP] Eregi error 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 ) {

[PHP] Eregi error

2007-02-28 Thread Brad
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\!\_ \.- ,/]*$';