{"record":{"id":"823332783d53c5c8","repo":"influxdata/influxdb","slug":"notregexmatch-function-not-registered","errorCode":null,"errorMessage":"NotRegexMatch function not registered","messagePattern":"NotRegexMatch function not registered","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/query_functions/src/lib.rs","lineNumber":83,"sourceCode":"/// col ~= /pattern/\n/// ```\npub fn regex_match_expr(input: Expr, pattern: String) -> Expr {\n    registry()\n        .udf(regex::REGEX_MATCH_UDF_NAME)\n        .expect(\"RegexMatch function not registered\")\n        .call(vec![input, lit(pattern)])\n}\n\n/// Return an Expr that invokes a InfluxRPC compatible regex match to\n/// determine which values do not satisfy the pattern. Equivalent to:\n///\n/// ```text\n/// col !~ /pattern/\n/// ```\npub fn regex_not_match_expr(input: Expr, pattern: String) -> Expr {\n    registry()\n        .udf(regex::REGEX_NOT_MATCH_UDF_NAME)\n        .expect(\"NotRegexMatch function not registered\")\n        .call(vec![input, lit(pattern)])\n}\n\n/// Create a DataFusion `Expr` that invokes `window_bounds` with the\n/// appropriate every and offset arguments at runtime\npub fn make_window_bound_expr(\n    time_arg: Expr,\n    every: WindowDuration,\n    offset: WindowDuration,\n) -> Expr {\n    let encoded_every: EncodedWindowDuration = every.into();\n    let encoded_offset: EncodedWindowDuration = offset.into();\n\n    registry()\n        .udf(window::WINDOW_BOUNDS_UDF_NAME)\n        .expect(\"WindowBounds function not registered\")\n        .call(vec![\n            time_arg,","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/query_functions/src/lib.rs#L65-L101","documentation":"`regex_not_match_expr` mirrors `regex_match_expr` for the `!~` operator and panics when the NotRegexMatch UDF is absent from the registry. The `.expect()` encodes the assumption that UDF registration happened at context construction. Seeing this panic means the registry was built without the negated regex-match UDF.","triggerScenarios":"Calling `regex_not_match_expr(input, pattern)` when `registry().udf(regex::REGEX_NOT_MATCH_UDF_NAME)` returns None — NotRegexMatch was never registered on the context.","commonSituations":"Manually constructed SessionContext without the crate's UDF registration; test helpers that registered RegexMatch but not NotRegexMatch; version drift renaming the UDF.","solutions":["Run the full UDF registration (all query_functions UDFs) on your context before building expressions.","Verify NotRegexMatch appears in the registry's UDF list.","Update registration code if the UDF name constant changed after an upgrade."],"exampleFix":"// before\nregister_udf(REGEX_MATCH_UDF_NAME); // partial registration\n// after\nregister_udf(REGEX_MATCH_UDF_NAME);\nregister_udf(REGEX_NOT_MATCH_UDF_NAME); // both variants","handlingStrategy":"type-guard","validationCode":"debug_assert!(registry().udf(regex::REGEX_NOT_MATCH_UDF_NAME).is_some(), \"NotRegexMatch UDF not registered\");","typeGuard":"fn has_regex_not_match_udf(registry: &SessionContext) -> bool {\n    registry.udf(regex::REGEX_NOT_MATCH_UDF_NAME).is_some()\n}","tryCatchPattern":"let udf = registry().udf(regex::REGEX_NOT_MATCH_UDF_NAME)\n    .ok_or_else(|| anyhow!(\"NotRegexMatch UDF not registered\"))?;","preventionTips":["Register RegexMatch and NotRegexMatch together in one registration function","Never build exprs on a bare context; go through the crate's registry","Enumerate all UDF name constants in a registration completeness test"],"tags":["rust","udf","regex","registry"],"backgroundTag":"internal-invariant-violation","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}