Re: Newbie pattern question

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

 



Hi,

  Try adding a space([a-zA-Z0-9_] => [a-zA-Z0-9_ ]), John Doe is false but JohnDoe would be true in the case below

Frantzcy

On Fri, 5 Nov 2004 20:55:00 +0200,"Phpu" <phpu@xxxxx> wrote:

> Hi,
> I have this function
> 
>  function validate_name($name) {
> 
>   if(ereg("^[a-zA-Z0-9_]{2,30}$", $name)) {
> 
>    return true;
> 
>   } else {
> 
>    return false;
> 
>   }
> 
>  }
> 
> If i enter a name like John for exemple everything is ok but if i
> enter John Doe the function return false.
> 
> Where is the problem?
> 
> Thanks
> 


-- 

Unreachability is bliss
-- 

Sleep, sometime in MAY... if lucky

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