Make #15 and #16 work, and introduce a helper function.

Also, introduce a helper function to test regexps.