An in-memory regex match is a lot cheaper than whacking the filesystem, so do that check first.