devscript: add list_pkg_ids_by_regexp

Inspired by @alebcay in #3431 .

This script allows a Cask author to test out various regular expressions
without having to run the install/uninstall cycle.