I need to find all of the instances of the following pattern:
<(h1|p) class="veronaText hidden" (.*?)>(Answer:|)</(h1|p)>
and replace it to add an ID and an extra class. How can I replace it so that it keeps its current formatting and attributes (h1 or p, etc)?
<(h1|p) class="veronaText hidden" (.*?)>(Answer:|)</(h1|p)>
becomes
<$1 id="newID" class="veronaText hidden newClass" $2>$3</$4>
each $n represents a submatch within the main match, in the order they appear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With