Regular expression - move content from tag A to tag B



I need help writing a regular expression that moves content from the title tag into the content tag.


This:



<xml>
<item>
<title>Title 1</title>
<content>Text 1</content>
</item>
<item>
<title>Title 2</title>
<content>Text 2</content>
</item>
</xml>


To this:



<xml>
<item>
<title>Title 1</title>
<content>Title 1 Text 1</content>
</item>
<item>
<title>Title 2</title>
<content>Title 2 Text 2</content>
</item>
</xml>

No comments:

Post a Comment