{"record":{"id":"d3b01ae0e1bb2b22","repo":"oracle/graal","slug":"unsupported-unicode-character-property-s","errorCode":null,"errorMessage":"Unsupported Unicode character property '%s'","messagePattern":"Unsupported Unicode character property '(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"regex/src/com.oracle.truffle.regex/src/com/oracle/truffle/regex/charset/UnicodeProperties.java","lineNumber":189,"sourceCode":"                case \"scx\":\n                    propertyValue = normalizeScriptName(propertyValue);\n                    break;\n                default:\n                    CompilerDirectives.transferToInterpreterAndInvalidate();\n                    throw new IllegalArgumentException(String.format(\"Binary property %s cannot appear to the left of '=' in a Unicode property escape\", propertySpec.substring(0, equals)));\n            }\n            return propertyName + \"=\" + propertyValue;\n        } else if (isSupportedGeneralCategory(propertySpec)) {\n            return \"gc=\" + normalizeGeneralCategoryName(propertySpec);\n        } else {\n            return normalizePropertyName(propertySpec);\n        }\n    }\n\n    private String normalizePropertyName(String propertyName) {\n        String name = returnOrThrow(propertyName, \"character property\", data.lookupPropertyAlias(propertyName, nameMatchingMode));\n        if (!withOtherProperties() && OTHER_PROPERTIES_NAMES_SET.contains(name)) {\n            throw new IllegalArgumentException(String.format(\"Unsupported Unicode character property '%s'\", propertyName));\n        }\n        return name;\n    }\n\n    private String normalizeGeneralCategoryName(String generalCategoryName) {\n        return returnOrThrow(generalCategoryName, \"character general category\", data.lookupGeneralCategoryAlias(generalCategoryName, nameMatchingMode));\n    }\n\n    private String normalizeScriptName(String scriptName) {\n        return returnOrThrow(scriptName, \"script name\", data.lookupScriptAlias(scriptName, nameMatchingMode));\n    }\n\n    private String normalizeBlockName(String blockName) {\n        if (!withBlocks()) {\n            throw new IllegalArgumentException(\"Unsupported Unicode character property escape\");\n        }\n        return returnOrThrow(blockName, \"block name\", data.lookupBlockAlias(blockName, nameMatchingMode));\n    }","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/regex/src/com.oracle.truffle.regex/src/com/oracle/truffle/regex/charset/UnicodeProperties.java#L171-L207","documentation":"After alias lookup, normalizePropertyName checks the resolved name against OTHER_PROPERTIES_NAMES_SET when the flavor/options disable 'OtherProperties'. Names in that set (e.g. ECMAScript 'Other_' convenience properties) are intentionally excluded, so using them throws IllegalArgumentException \"Unsupported Unicode character property '%s'\".","triggerScenarios":"Using a property from the OtherProperties set (such as \\p{Other_Alphabetic} style names) in a regex compiled with options where withOtherProperties() is false — typically flavors/modes that only expose the core Unicode property set.","commonSituations":"Sharing one pattern string across multiple regex flavors (e.g. ECMAScript host and a non-ECMAScript flavor); patterns relying on ECMAScript 'Other_*' convenience properties run under a JavaUtilPattern-like or reduced-property configuration.","solutions":["Replace Other_* properties with the underlying core property or an explicit character class.","Keep flavor-specific patterns separate and only use Other_* where the flavor enables them.","Enable a flavor/options set that supports other-properties if your use case requires them."],"exampleFix":"// before\nString p = \"\\\\p{Other_Uppercase}\"; // throws in flavors with withOtherProperties()==false\n\n// after\nString p = \"\\\\p{Uppercase}\"; // core property, supported everywhere","handlingStrategy":"validation","validationCode":"private static final Set<String> OTHER_PROPS = Set.of(\n    \"Other_Alphabetic\", \"Other_Uppercase\", \"Other_Lowercase\", \"Other_Ideographic\");\n\nstatic boolean safeForFlavor(String propertyName, boolean flavorSupportsOther) {\n    return flavorSupportsOther || !OTHER_PROPS.contains(propertyName);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Maintain per-flavor pattern variants instead of one shared string.","Prefer core Unicode properties (Alphabetic, Uppercase) over Other_* forms.","Smoke-test shared patterns in every flavor you compile them in."],"tags":["regex","truffle","unicode","property-escape","flavor"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}