Ciò non impedirà alle persone di inserire espressioni wildcard “normali” e poi attivare watched words regular expressions enabled, che è quello che è successo qui.
Penso che abbia solo bisogno di un gestore di eccezioni attorno alla chiamata regexp
def word_matches?(word, case_sensitive: false)
options = case_sensitive ? nil : Regexp::IGNORECASE
Regexp.new(WordWatcher.word_to_regexp(word), options).match?(@raw)
end