Forum Moderators: coopster
Allowed input,
a-z
A-Z (but not two in a row, so no all caps)
numbers 2 and 4
dash
whitespace (other than beginning or end)
This is the best I've come up with so far,
$input = check_input($_POST['input']
(preg_match("/[^a-z24\- ][A-Z]{1}/",$input))
Whenever I add more to the preg_match it stops matching something else. Sometimes numbers other than 2 or 4 are allowed sometimes they're not, don't know why.
One oddity is that every once in a while if you enter something that validates and submit it then if you add one of the characters not allowed and submit again then it will pass right thru without errors.
Like, I'll enter abc and submit. Then change abc to abc# or ab3c and sometimes it passes validation. Kinda strange.