Hi Monks
I am trying the following regex to match the numbers after the decimal. If my input is -1.500, output is coming only as 5. Infact, it should be 500. Please help to correct my regex.
my $price = -1.500; if ( $price =~ m/^-\d+\.(\d*)$/g ) { print "matched $1 \n"; }
In reply to regex to match numbers after decimal by doubledecker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |