my $number = $1 if $string =~ m/\(([\d,]+)\)/; $number =~ s/,//g; # how I would approach the problem...