if ( ($payment=~/^\s*\$?(?:\d{1,3},?(?=\d{3}))*[0-9]{1,3}(?:\.\d{2})?$/) && ($payment <= 99999.99) ) {print "right";}else{print "wrong";}