Reputation: 33
I have a document that looks something like this:
<Objects>
<Object>
<Id>1</COLUMN>
<Type>Type1</COLUMN>
<Name>Some name</COLUMN>
</Object>
<Object>
<Id>2</COLUMN>
<Type>Type2</COLUMN>
<Name>Some name2</COLUMN>
</Object>
</Objects>
How can I replace all the </COLUMN>
in the end of the lines so they match the type shown in the beginning of the lines using Notepad++? I want the result to be something like this:
<Objects>
<Object>
<Id>1</Id>
<Type>Type1</Type>
<Name>Some name</Name>
</Object>
<Object>
<Id>2</Id>
<Type>Type2</Type>
<Name>Some name2</Name>
</Object>
</Objects>
Upvotes: 0
Views: 86
Reputation: 13640
You can use the following to match:
(<([^>]+)>[^<]+)<\/COLUMN>
And replace with the following:
\1<\/\2>
See RegEX DEMO
Upvotes: 1