in reply to String replace - Part II

Like hippo, I don't really understand the questions(s) you're asking in the OP, and I agree with his or her recommendations here. That said, I can hazard an answer based on part of your post:

The exclusion of an entire word, not just characters ...

I think what you may be asking for is an alternative to  [^somechars] (an inverted character class) in an  [^somechars]* expression that will generalize to any pattern. Something like this may fill the bill:

c:\@Work\Perl\monks>perl -wMstrict -le "my $pattern = qr{ \b f[eio]e \b }xms; ;; my $str = 'foo bar feeble macfee unfeeling fee fumble'; ;; print qq{match: '$1'} if $str =~ m{ (bar (?: (?! $pattern) .)* f \w+) + }xms; " match: 'bar feeble macfee unfeeling fee'
The  (?: (?! $pattern) .)* sub-pattern matches "zero or more of any character so long as the character is not at the start of something matching $pattern." Contrast with the behavior of
    m{ (bar .* f \w+) }xms
(Update: Also contrast with  m{ (bar (?: (?! $pattern) .)*? f \w+) }xms (note  ? "lazy" quantifier modifier).)

Update: As a parenthetic note, the example above can be extended to show regex composition:

c:\@Work\Perl\monks>perl -wMstrict -le "my $giant_sez = qr{ \b f[eio]e \b }xms; my $not_giant = qr{ (?! $giant_sez) . }xms; ;; my $str = 'foo bar feeble macfee unfeeling fee fumble'; ;; print qq{match: '$1'} if $str =~ m{ (bar $not_giant* f \w+) }xms; " match: 'bar feeble macfee unfeeling fee'
Again, contrast with  m{ (bar $not_giant*? f \w+) }xms


Give a man a fish:  <%-{-{-{-<