in reply to How to not match some words but match all the others
What if you continue to match them, but not alter them if they are in your stoplist?
# assuming @stoplist my %stop; @stop{ @stoplist } = @stoplist; s/(\w+)/ ( $stop{$1} || ! defined $self->{$1}{val} ) ? $1 : $self->{$1}{val} /ge;
Might not be ultra-efficient, though.
|
|---|