{"record":{"id":"714cf4de86433f77","repo":"kestra-io/kestra","slug":"the-argument-regex-is-required-714cf4","errorCode":null,"errorMessage":"The argument 'regex' is required.","messagePattern":"The argument 'regex' is required\\.","errorType":"validation","errorClass":"PebbleException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/io/kestra/core/runners/pebble/filters/RegexMatchFilter.java","lineNumber":52,"sourceCode":"    public static final String NAME = \"regexMatch\";\n\n    private static final String ARGUMENT_REGEX = \"regex\";\n\n    private static final List<String> ARGS = List.of(ARGUMENT_REGEX);\n\n    @Override\n    public List<String> getArgumentNames() {\n        return ARGS;\n    }\n\n    @Override\n    public Object apply(Object input, Map<String, Object> args, PebbleTemplate self, EvaluationContext context, int lineNumber) throws PebbleException {\n        if (input == null) {\n            return false;\n        }\n\n        if (args.get(ARGUMENT_REGEX) == null) {\n            throw new PebbleException(\n                null,\n                MessageFormat.format(\"The argument ''{0}'' is required.\", ARGUMENT_REGEX),\n                lineNumber,\n                self.getName()\n            );\n        }\n\n        String regex = args.get(ARGUMENT_REGEX).toString();\n        try {\n            return RegexUtils.matcher(Pattern.compile(regex), input.toString()).find();\n        } catch (PatternSyntaxException e) {\n            throw new PebbleException(e, MessageFormat.format(\"Invalid regex ''{0}'': {1}\", regex, e.getDescription()), lineNumber, self.getName());\n        } catch (RegexUtils.RegexTimeoutException e) {\n            throw new PebbleException(e, e.getMessage(), lineNumber, self.getName());\n        }\n    }\n}\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/runners/pebble/filters/RegexMatchFilter.java#L34-L70","documentation":"Thrown by the 'regexMatch' Pebble filter when the required `regex` argument is null or missing. The filter uses `find()` semantics (partial match) and needs a pattern before it can compile and evaluate.","triggerScenarios":"Writing `{{ s | regexMatch }}` without arguments; passing a variable for the regex that resolved to null; misspelling the argument (e.g. `pattern=` instead of `regex=`).","commonSituations":"Refactoring a flow and dropping the regex argument; referencing an unset input as the pattern; copy-paste errors.","solutions":["Supply the named argument: `{{ s | regexMatch(regex=\"^abc\") }}`.","If the pattern is dynamic, default it: `regex=inputs.pattern ?? \".*\"`.","Remember this filter does partial match (find), not full match."],"exampleFix":"# before\n{{ email | regexMatch }}\n# after\n{{ email | regexMatch(regex=\"^[^@]+@[^@]+\\\\.[^@]+$\") }}","handlingStrategy":"validation","validationCode":"# Always supply the regex argument:\n{{ s | regexMatch(regex=inputs.pattern ?? \".*\") }}","typeGuard":"{% if inputs.pattern is not null %}\n  {{ s | regexMatch(regex=inputs.pattern) }}\n{% endif %}","tryCatchPattern":null,"preventionTips":["Always pass `regex` as a named argument to regexMatch.","Remember regexMatch uses partial match (find), not full match.","Default dynamic patterns to a safe value like `.*`."],"tags":["pebble-filter","regex-match","missing-argument","regex"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}