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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Interpolate Text Not Inside a Certain Tag
by ikegami (Patriarch) on Apr 07, 2005 at 17:37 UTC | |
by jonadab (Parson) on Apr 09, 2005 at 00:17 UTC |