I want to test a string for proper apha numeric formatting such as :
$my_string=1FUD567894; 1 numeric, 3 alpha, 5 numeric.
Tried this code but something is not quite right:
if (!ereg("(([0-9]{0,1})+([A-Z]{2,4})+([0-9]{5,10}))$", $my_string)) {
echo "Wrong format";
} else {
echo "Pass test";
}
Thanks,
BB