Is it possible to find all text inside a node and take the matched text and replace the contents of a node using only a single regular expression? I should say that this is in a file.
Given:
<x>This text</x>
<!-- Unknown number of nodes between <x> and <y> -->
<y>Junk</y>
Change to:
<x>This text</x>
<!-- Unknown number of nodes between <x> and <y> -->
<y>This text</y>
Normally, I would do a regular expression to find the contents of x and store it in a variable. Then, I would run a second regular expression to find the contents of y and replace it with the variable's data. Just wondering if there is a "1-step" solution... Thanks.