void () { RegExpLexer lexer = new RegExpLexer(EnumSet.of(TRANSFORMATION_ESCAPES)); final String text = "\\U$1\\E\\u$3\\l$4\\L$2\\E"; doTest(text, """ CHAR_CLASS ('\\U') DOLLAR ('$') CHARACTER ('1') CHAR_CLASS ('\\E') CHAR_CLASS ('\\u') DOLLAR ('$') CHARACTER ('3') CHAR_CLASS ('\\l') DOLLAR ('$') CHARACTER ('4') CHAR_CLASS ('\\L') DOLLAR ('$') CHARACTER ('2') CHAR_CLASS ('\\E')""", lexer); lexer = new RegExpLexer(EnumSet.noneOf(RegExpCapability.class)); doTest(text, """ INVALID_CHARACTER_ESCAPE_TOKEN ('\\U') DOLLAR ('$') CHARACTER ('1') INVALID_CHARACTER_ESCAPE_TOKEN ('\\E') INVALID_UNICODE_ESCAPE_TOKEN ('\\u') DOLLAR ('$') CHARACTER ('3') INVALID_CHARACTER_ESCAPE_TOKEN ('\\l') DOLLAR ('$') CHARACTER ('4') INVALID_CHARACTER_ESCAPE_TOKEN ('\\L') DOLLAR ('$') CHARACTER ('2') INVALID_CHARACTER_ESCAPE_TOKEN ('\\E')""", lexer); }