Add logic to patternIsBadlyFormed to check whether a subpattern invocation occurs inside a character class; add exception messages for this eventuality