{"record":{"id":"e9e68632ec883a01","repo":"oracle/graal","slug":"unsupported-unicode-character-property-escape","errorCode":null,"errorMessage":"Unsupported Unicode character property escape","messagePattern":"Unsupported Unicode character property escape","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"regex/src/com.oracle.truffle.regex/src/com/oracle/truffle/regex/charset/UnicodeProperties.java","lineNumber":141,"sourceCode":"    public CodePointSet unionOfProperties(CodePointSet initial, String... properties) {\n        CodePointSetAccumulator acc = new CodePointSetAccumulator();\n        if (initial != null) {\n            acc.addSet(initial);\n        }\n        for (String property : properties) {\n            acc.addSet(getProperty(property));\n        }\n        return acc.toCodePointSet();\n    }\n\n    /**\n     * @param propertySpec *Normalized* Unicode character property specification (i.e. only\n     *            abbreviated properties and property values)\n     */\n    private CodePointSet evaluatePropertySpec(String propertySpec) {\n        CodePointSet prop = data.retrieveProperty(propertySpec);\n        if (prop == null) {\n            throw new IllegalArgumentException(\"Unsupported Unicode character property escape\");\n        }\n        return prop;\n    }\n\n    /**\n     * @param propertySpec *Normalized* Unicode character property specification (i.e. only\n     *            abbreviated properties and property values)\n     */\n    private ClassSetContents evaluatePropertySpecStrings(String propertySpec) {\n        ClassSetContents prop = data.retrievePropertyOfStrings(propertySpec);\n        if (prop == null) {\n            throw new IllegalArgumentException(\"Unsupported Unicode character property escape\");\n        }\n        return prop;\n    }\n\n    private String normalizePropertySpec(String propertySpec) {\n        int equals = propertySpec.indexOf('=');","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/regex/src/com.oracle.truffle.regex/src/com/oracle/truffle/regex/charset/UnicodeProperties.java#L123-L159","documentation":"When a regex uses a Unicode property escape like \\p{...}, UnicodeProperties.evaluatePropertySpec normalizes the spec and looks it up in the compiled property database. If retrieveProperty returns null (unknown property/value combination after normalization), it throws IllegalArgumentException 'Unsupported Unicode character property escape'.","triggerScenarios":"Compiling a pattern containing \\p{UnknownProperty} or a property name/value alias not present in the Unicode data shipped with the engine, e.g. \\p{Script=Foo} or a property introduced in a newer Unicode version than the database.","commonSituations":"Patterns written against a newer JDK's java.util.regex Unicode data (new properties like Emoji_* or newer script names) run on a GraalVM/TRegex build with older Unicode data; properties supported only by specific flavors (e.g. OtherProperties) used in a flavor that disables them.","solutions":["Replace the unsupported property with an equivalent supported one or an explicit character class/range.","Check which Unicode version/property set your TRegex build supports (UnicodeProperties data) and use only those names.","Upgrade GraalVM/TRegex so the property database matches the Unicode version your pattern targets.","For exotic properties, precompute the code point set yourself and build an explicit class."],"exampleFix":"// before\nPattern p = compile(\"\\\\p{Grapheme_Cluster_Break=Extend}\"); // not in property DB\n\n// after\n// approximate with explicit ranges / supported property\nPattern p = compile(\"[\\\\u0300-\\\\u036F\\\\u200C\\\\u200D]\");","handlingStrategy":"try-catch","validationCode":"// pre-check a property spec against the engine's supported set\nboolean supported = props.isSupportedProperty(\"Grapheme_Cluster_Break\");\n// for enumerated forms: normalize then check, e.g. isSupportedScript / isSupportedGeneralCategory","typeGuard":null,"tryCatchPattern":"try {\n    return engine.compile(patternWithPropertyEscape);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"Unicode character property\")) {\n        return compileWithExplicitClassFallback(patternWithPropertyEscape);\n    }\n    throw e;\n}","preventionTips":["Restrict patterns to properties of the Unicode version compiled into your TRegex build.","Replace exotic properties with explicit ranges generated offline.","When porting patterns between engines, diff their supported property lists first."],"tags":["regex","truffle","unicode","property-escape","compilation"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}