my $clauses = join "|", map {quotemeta} @SearchTexts;
s{\b($clauses)\b}{<b>$1</b>}ig;
- No need for the double matching.
- Use different delimiters if you have a slash in your replacement.
- No need to escape < or >.
- Don't use /o unless you're an expert (and then you won't).
- Don't use \1 in the replacement. That's what $1 is for.
- Eat more spinach.