Hi there,
I'm trying to write some validation script using regular expressions. I would like the rules to be that the string must be made up of alphabetical or numerical characters and must be from 1 to 15 characters long. I can get the first part (the character restrictions) but I can't get the length range to work at all. Here is the code as it is now - it is part of a larger switch statement, the value of $value is delivered correctly.
case password:
$password = $value;
if(!ereg("^([a-zA-Z0-9]+){1,15}$", $value))
{
print("Passwords must be 15 characters or less and may contain no symbols.");
}
Any help with this would be appreciated, I've even tried splitting it into to regex with two if statements using
ereg(^.{1,15}$)
but was unsuccessful with that as well. Thank you.
Cat