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