Metatext home page
Search...
⌘K
Support
Dashboard
Dashboard
Search...
Navigation
Rules catalog
Regex
Documentation
API reference
Recipes
Github - Recipes & examples
Community
Blog
Getting started
Quickstart
Introduction
Real-time protection
Evaluate
Policies and guardrails
Rules catalog
Policy Rules Catalog
Jailbreak
Classifier
Factuality
Similarity
Rubric
Regex
Contains (string match)
Model based rules
Use cases
Risk assessment
Probes Catalog
Scan vulnerabilities
Manage GenAI applications
Application setup
On this page
Parameters:
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, or
pass
to ensure the pattern is present
threshold
: Not applicable for regex rules, as they are based on exact pattern matching
Rubric
Contains (string match)
Assistant
Responses are generated using AI and may contain mistakes.