1. Not even a script
$ perl -nle '/regex with (capture)/ && print $1'
Or since 5.10:
$ perl -nE '/regex with (capture)/ && say $1'