If it is easy, wouldn't mind excluding these entry options as well:
-[space][letters]
-[letters][space]
But, no big deal as I can trim those out when I post form.
Code: Select all
elseif(!preg_match("/^([a-zA-Z])+$/", $_POST['servingunits'])) {
$reqverrors[] = "Yes";
$errName = "\t<br><span class=pred>Units must be from letters and spaces.</span>\n";
}
I tried this but it didn't work
Code: Select all
elseif(!preg_match("/^([a-zA-Z[color=#FF0000] ]) ([ a-zA-Z])[/color]+$/", $_POST['servingunits'])) {
$reqverrors[] = "Yes";
$errName = "\t<br><span class=pred>Units must be from letters and spaces.</span>\n";
}