I am trying to do some form field validation with regular expressions, I need one which will only allow letters and numbers to be typed. And another which only allows numbers.
So far i have - for numbers + characters->
eregi("[a-z0-9]|[0-9a-z]", $check)
and for numbers..
ereg("[0-9]*", $check)
The problem is that they both seem to only check the first digit's validity. And after that you can type any kind of character.
Help!