preformance fix for RegexpCheck

Originally submitted as part of one big PR #136