Rules catalog
Regex
Regex rule for guardrails
The regex
rule is used to match specific patterns in the content using regular expressions.
Parameters:
- type:
regex
(specifies the rule type) - value: A string containing the regular expression pattern to match
- expected: Usually set to
fail
to flag when the pattern is found, orpass
to ensure the pattern is present - threshold: Not applicable for regex rules, as they are based on exact pattern matching