Think about Loose Coupling | |
PerlMonks |
Re^2: "em" - Emphasize text using regular expressionsby FloydATC (Deacon) |
on Apr 19, 2013 at 13:48 UTC ( [id://1029519]=note: print w/replies, xml ) | Need Help?? |
Is there a reason you can't do this yourself?I'm lazy. And a little bit out of my depth. You'll need to document this in a little more detailUpdate: This problem has been fixed. Finally :-)
The problem
For every expression that matches, the script
Example 1:
Example 2:
Instead of a simple substitution, I now keep an array of the codes I would insert. For each matching rule, I now scan this array to find the proper "reset color code" instead of just inserting a plain ANSI reset. Only when all the matching has finished I apply the codes using substr().
--
Time flies when you don't know what you're doing
In Section
Cool Uses for Perl
|
|