in reply to Replacing 3 and 4 digit numbers.
Does variable contain html before you try your digits substitution?
If the answer is no, do the digits_4/digits_3 substitution in a single pass
If the answer is yes, use a parser, like XML::Twig or HTML::TreeBuilder::XPath, XML::LibXML, to either find nodes using "xpath" and regex
You could also use only regex but its harder to write match *bold* formatting, but avoid html, Re: match *bold* formatting, but avoid html (tokenize)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Replacing 3 and 4 digit numbers. (html hilite highlight bold)
by beech (Parson) on Apr 07, 2016 at 08:52 UTC |