Help for this page
my ($match) = $string =~ /$regex/;
perl -ne '/$regex/, $SUM += $1; END { print $SUM }' file.txt