in reply to Re^2: Regular Expression Currency Check
in thread Regular Expression Currency Check

This code still matchs on 1,00000.00
Where is the problem here?
if ( ($payment=~/^\s*\$?(?:\d{1,3},?(?=\d{3}))*[0-9]{1,3}(?:\.\d{2} +)?$/) && ($payment <= 99999.99) ) {print "right";}else{print "wrong";}

Replies are listed 'Best First'.
Re^4: Regular Expression Currency Check
by cool_jr256 (Acolyte) on Jun 02, 2005 at 15:18 UTC
    if you do $payment <= 99999.99 it will never match with 1,00000.00 since ',' is a character