RE: Eregi error

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

 



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, otherwise
it will be treated as a range.

Best regards,
Peter Lauri

www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free

-----Original Message-----
From: Brad [mailto:brad@xxxxxxxxxxxxx] 
Sent: Thursday, March 01, 2007 5:09 AM
To: PHP Mailing
Subject:  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 ) {
            $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

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