Don't leak invalid RegexDirectives. Probably a small part of PR19520.