in reply to $1 and regex
while (<>) { / (\d+) .*? to .*? (\d+) /x and print "$1\n$2\n"; } [download]