Skip to content

regex

regex

Classes:

Name Description
RegexCandidate

A regex match supplied to a user-defined local validator.

RegexValidationResult

Result returned by a user-defined local regex validator.

RegexLimits

Per-record, per-rule bounds shared by built-in and custom regex rules.

BuiltinRegex

Configuration for one recognizer from the built-in regex registry.

RegexRule

A user-defined regex rule for producing entity candidates.

RegexCandidate(value, start, end, groups, context, rule_id) dataclass

A regex match supplied to a user-defined local validator.

RegexValidationResult(valid, reason=None) dataclass

Result returned by a user-defined local regex validator.

RegexLimits pydantic-model

Bases: BaseModel

Per-record, per-rule bounds shared by built-in and custom regex rules.

Config:

  • extra: forbid
  • hide_input_in_errors: True

Fields:

  • max_matches_per_rule (int)
  • min_timeout_seconds (float)
  • timeout_seconds_per_million_characters (float)

BuiltinRegex pydantic-model

Bases: BaseModel

Configuration for one recognizer from the built-in regex registry.

Config:

  • extra: forbid

Fields:

Validators:

  • validate_label → label

validate_matches_with_llm = True pydantic-field

Whether regex-produced matches receive contextual LLM validation.

detect_additional_matches = True pydantic-field

Whether GLiNER and LLM augmentation may find additional matches for this label.

RegexRule pydantic-model

Bases: BaseModel

A user-defined regex rule for producing entity candidates.

Config:

  • arbitrary_types_allowed: True
  • extra: forbid

Fields:

Validators:

  • validate_label → label
  • validate_pattern → pattern
  • validate_validator → validator

validate_matches_with_llm = True pydantic-field

Whether regex-produced matches receive contextual LLM validation.

detect_additional_matches = True pydantic-field

Whether GLiNER and LLM augmentation may find additional matches for this label.