Ver original$regex = '#^[a-z]*[0-9][a-z0-9]*$#i'; if((preg_match($regex, $variable))){ echo "ok";}else{ echo "error";}