Tell me, though, why is it necessary to have two [0-9]'s?
I tried the script as: "if ($2 ~ /^[0-9]*$/) {doNumeric }" and it seems to give the results I want.
A single [0-9] will work OK, but it will also match a blank field - the * means 0 or more occurrences of the expression. By using [0-9][0-9] we are ensuring we have at least 1 occurrence of a digit.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.