RegexMatch
relationalai.semantics.std.re
RegexMatch(regex: StringValue, value: StringValue, offset: IntegerValue = 0)Represents a regex match result with position and grouping support.
Methods
Section titled “Methods”.start()
Section titled “.start()”RegexMatch.start() -> VariableGet the starting position of the match.
Returns:
Variable- The 0-based starting position of the match.
.end()
Section titled “.end()”RegexMatch.end() -> VariableGet the ending position of the match.
Returns:
Variable- The 0-based ending position of the match.
.span()
Section titled “.span()”RegexMatch.span() -> tuple[Variable, Variable]Get the start and end positions of the match.
Returns:
tuple[Variable,Variable] - A tuple of (start, end) positions.
.group()
Section titled “.group()”RegexMatch.group(index: IntegerValue = 0) -> VariableGet a capture group by index.
Parameters:
(indexIntegerValue, default:0) - The index of the capture group (0 for the entire match). Default: 0.
Returns:
Variable- A Variable representing the capture group content.
.group_by_name()
Section titled “.group_by_name()”RegexMatch.group_by_name(name: StringValue) -> VariableGet a named capture group.
Parameters:
(nameStringValue) - The name of the capture group.
Returns:
Variable- A Variable representing the named capture group content.
Inheritance Hierarchy
Section titled “Inheritance Hierarchy”Returned By
Section titled “Returned By”semantics > std > re ├── fullmatch ├── match └── search