RegexModel
Sample Pattern
RegexModel
Bases: Model
Initialize RegexModel with a dictionary of patterns.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
patterns
|
Dict[str, str]
|
Dictionary where key is pattern name and value is regex pattern. |
None
|
Source code in guardrails_genie/regex_model.py
check(text)
Check text against all patterns and return detailed results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text
|
str
|
Input text to check against patterns |
required |
Returns:
Type | Description |
---|---|
RegexResult
|
RegexResult containing pass/fail status and details about matches |