>   RN> At 9:01 AM -0400 8/11/2001, Ranga Nathan wrote:
>   >> I have a string like "Balance is: 123,245.90"
>   >> when I match using /^Balance.*?([\d\,\.])/ 
>   >> I get a number that includes the commas.
>   >> Is there any way to get rid of the comms while matching?

this will do it,but it won't catch bad numbers.

my $money = "12,345,678,901,234,567.89";
my $value = '';
$value .= $1 while ($money =~ /\G(\.?\d{1,3}),?/cg);
print "value is $value \n";

course, it depends on you're definition of one expresion.
there's only one regexp, but the while loop sits and
pounds on it for a while.

Reply via email to