in reply to Re^2: regex: Need help substituting
in thread regex: Need help substituting

You can do whatever calculations you like in the XML::Twig tag handler. Trying to do this with regexen is like hammering in a screw---you can do it but it's neither the easiest nor the most adequate way, so just don't.