Thanks grawity, it helped me broaden my search to herehere to cover multiple search and replace in one regex.
Trying the following works:
Find: </ITEM_.*(>)|<ITEM_(.*)(>)
Replace: (?1</ITEM>)(?2<ITEM>\n<ID>\2</ID>)
RegEx
The | separates 2 strings looked for and the ?1 and ?2 are their respective replacements.
But I have to look for the closing </ITEM
tag first, not the <ITEM
tag as you would logically figure. So I have a solution, but can anyone answer the question as to why the above works but the following, looking for <ITEM
tag first, fails when we're just reversing the order in which we look?
Find: <ITEM_(.*)(>)|</ITEM_.*(>)
Replace: (?1<ITEM>\n<ID>\1</ID>)(?2</ITEM>
RegEx
Not essential, but enquiring minds might like to know. Thanks.