Patched SentenceValidator for better regexp performance.