Check for a behavior change in regular expression pattern matching

There is a behavior change involving pattern matching in regular expressions in Java SE 17. Previously, when one or more nested character classes (surrounded by []) followed an intersection (&&) was followed by a non-nested character class, the series of nested character classes were not used. In Java SE 17, those nested character classes are now used. For example, given the regular expression:

"[A-Z&&[A-Z]0-9]" - The [A-Z] would previously not have been used.

The rule flags calls invocations of the following methods where the regular expression provided contains an intersection, followed by a nested character class, followed by a non-nested character class:

For more information on this behavior change, see RegEx Pattern Matching Loses Character Class After Intersection (&&) Operator.