I'm using PHP 4.3 and am trying to do a simple password check (only alpha-numerics, with length 5 to 12) with this :
if ( eregi ( '( [a-z0-9]{5,12} )', $pWord ) )
{
return; // success !
}
else
{
// error routine !
}
When I submitt a password as "abc123" ereg skips the return statement and goes to the error routine!
But if I remove the '' everything works properly, except now ereg lets the special chars pass.
Same results if I negate the return as :
if ( !eregi ( . . .
everything works properly, BUT, now the function allows special chars to pass as well! I've dinked around with this freaking thing all day and can't see where the syntax is wrong, as it follows the PHP manual exactly.
I'm about ready to junk ereg() and roll my own function.