while ($string =~ s/]+\))<.+?(\d+\.\d+)//s) { print "$1 -- $2 \n"; } ]+\)) <-- will grab the currency name, $1 <.+? <-- slurp more, not greedy (\d+\.\d+) <-- will grab the currency value, $2