in reply to removing words
Your pattern only removes words that have a digit or a percent sign on both sides.
You didn't include a sample of your data, but for anything resembling normal English text the "word boundary" would work better:
If the data really has words separated by digits or percent signs or the beginning/end of a line you might try this:$title =~ s/\b$_\b//gsi;
$title =~ s/(^|[%\d])$_([%\d]|$)/$1$2/gsi;
|
|---|