Jeepers
09-05-2003, 07:27 PM
Hi all
Please forgive me, I'm usless at regular expressions. I've altered one to check that only digits are present, it is positive and an integer, if not zero the variable and it seems to work ok.
unless ($varname =~ /^[+]?(\d+)$/) {$varname=0;}
Can anyone spot a possible problem with the code, would it let other things through that I've not tested for or is there a better way of doing it?
Please forgive me, I'm usless at regular expressions. I've altered one to check that only digits are present, it is positive and an integer, if not zero the variable and it seems to work ok.
unless ($varname =~ /^[+]?(\d+)$/) {$varname=0;}
Can anyone spot a possible problem with the code, would it let other things through that I've not tested for or is there a better way of doing it?