Cache regexps for testing classes