use the scanner instead of a regex and memory

* Should be slower in the case where memory is large enough
to fit the corpus, but much faster in the case where it's not.
Has a much better failure mode than thrashing the disk, and is
only a once-off penalty.