in reply to Validating numeric input

Hi, Below code validates for exact 2 numbers.
if ($value !~ /^\d{2}$/) { print "input contains more than two digit"; }
If input contains negative number or so. Then
if ($value !~ /^(-)*\d{2}$/) { print "input contains more than two digit"; }
cheers, --c

Replies are listed 'Best First'.
Re^2: Validating numeric input
by VSarkiss (Monsignor) on Feb 05, 2005 at 20:05 UTC