# sample matches: $3,023,123.34 / 9,876,453 / 123456.78 # sample non-matches: 4,33,234.34 / $1.234 / abc #"^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$" #"^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$" if ($payment=~/^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$/g) { print "*match*$payment*match*
"; }else{print "No match";}