Re: Eregi error
| From: | M.Sokolewicz | Date: | Thu, 01 Mar 2007 11:32:02 +0000 |
| Subject: | Re: Eregi error | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-249647@lists.php.net to get a copy of this message | ||
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 what way?)
- tul
Nicholas Yim wrote:
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 standard_input($input, $min=0, $max=50){= = = = = = = = = = = = = = = = = = = = Nicholas Yim nick.yim@taowap.com 2007-03-01if (strlen($input) <= $max and strlen($input) >= $min ) { $pattern = '^[a-z0-9\!\_ \.- ,/]*$'; if(!eregi($pattern, $input)){ return false; }else{ return true; } }else{ return false; } }And i am running PHP version 5.2.1 I receive the following error: *Warning*: eregi() [function.eregi <http://idontwanttouse.net/MeetMyMate/Bin/Debug/function.eregi>]: REG_ERANGE in *[File Location]* on line *287 *Any ideas what might cause this? Googling REG_ERANGE only showed more questions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php