Why is `Pattern.compile (" (?: \ U00e9) ", Pattern.CANON_EQ)` throw?

There are no restrictions on the regular expression compiled using Pattern.CANON_EQ . However

 Pattern.compile("(?:\u00e9)",Pattern.CANON_EQ); 

throws an exception:

 java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 11 ((?:é)|é)|e)́) ^ 

Note that the pattern is a normalized string. This seems like a bug in the JRE, but I cannot find such a bug in the problem tracker.

+6
source share

Source: https://habr.com/ru/post/908342/


All Articles