Why they are called Regular Expressions, I am not to sure. They should be
called Frustrating Expressions.

Once again I have what should be a simple problem and yet the solution
eludes me. I am creating a prompt that can only accept a number, it works
but with one exception, when someone enters a string with both numbers and
letters it accepts it.

eg:
12 - is accepted
bob - is not accepted
OK so far, now the problem;
12bob - is accepted
bob12 - is accepted

As you can see the last two inputs should not be accepted. I am using $x =~
/[0-9]/ as my filter. I understand why the values are being accepted, I am
searching for a number and 12bob & bob12 each contain a number.

What I do not understand is how to search for just a number.

All help is appreciated,

Stefan

Reply via email to