pyrit.prompt_converter.RegexSelectionStrategy#
- class RegexSelectionStrategy(*, pattern: str | Pattern)[source]#
Bases:
TextSelectionStrategySelects text based on the first regex match.
- __init__(*, pattern: str | Pattern) None[source]#
Initializes the regex selection strategy.
- Parameters:
pattern (Union[str, Pattern]) – The regex pattern to match.
Methods
__init__(*, pattern)Initializes the regex selection strategy.
select_range(*, text)Selects the range of the first regex match.