I don't think the "fix" used will work. The line is now:
$eng =~ s/\b(?!p)sub/rubber dub/ig; # thanks to xaco for spotting this
This looks to me like "replace word/non-word boundary followed by something which is 's' and not 'p' followed by 'u' followed by 'b' by 'rubber dub'". This will still replace 'nuclear sub' with 'nuclear rubber dub'. The (?!p) is superfluous because the next character can never be a 'p' anyway, since you say it must match /s/i.
Easiest is probably just to switch the order of the rules, since you can't say "replace the word 'sub' except it if used to be the word 'pub'" :)
In reply to Re: Re: CRSC
in thread CRSC
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||