in reply to Re^3: Challenge: Transforming markups
in thread Challenge: Transforming markups

This can be easily fixed by using named backreferences. \k<named> would refer to a match of the pattern (?<named>...).