http://www.perlmonks.org?node_id=445800


in reply to Interpolate Text Not Inside a Certain Tag

First off, dragonchild's answer is well worth considering, and probably the better choice. But for the sake of interest... I think it may be possible to do this with a regex, provided the problem really is as simple as the way you have stated it and not complicated by additional nesting or somesuch. Something along these lines...

s!(?:(?:([']{2})([^']+)[']{2})|(?:([*]{2})([^'*]+)[*]{2}))!($3 eq '**')?"<b>$4</b>":$2!ge;

...might work. (No, lots of paretheses don't bother me. Yep, I knew a lisp variant before I learned Perl.) But dragonchild's solution is easier to read and maintain.

update: fixed silly paren-counting error

"In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."  — Pratico & Van Pelt, BBHG, p68