$res->{pos ($string)} = [$1, $2, $3] while $string = /$regex/g;