cache the Pattern objects, not the pattern strings