pyrit.prompt_converter.WordRegexSelectionStrategy#
- class WordRegexSelectionStrategy(*, pattern: str | Pattern[str])[source]#
Bases:
WordSelectionStrategySelects words that match a regex pattern.
- __init__(*, pattern: str | Pattern[str]) None[source]#
Initialize the word regex selection strategy.
Methods
__init__(*, pattern)Initialize the word regex selection strategy.
select_range(*, text[, word_separator])Select a character range by first selecting words, then converting to character positions.
select_words(*, words)Select words that match the regex pattern.