Hello,
You need to perform this replace manually(a one time thing) or do you need this for an application/script that does this automatically/repeatedly?
To me it seems you primarily need to rename the
section elements to
bridgehead. In Oxygen you can easily do this with the
Rename Element(ALT+SHIFT+R) action from the contextual menu(right click on a tag and choose Refactoring -> Rename Element...). In the "Rename" dialog choose the "Rename siblings with the same name" option to rename all the sibling elements.
Or, though it would complicate things needlessly, you could use the Find/Replace and search for
section, replace with
bridgehead use the XPath:
//section, set the
Enable XML search options and make sure only
Element names is selected from the bottom section.
If for some reason(e.g. you need to do this programatically) you still want to do this with regular expressions, search for:
- Code: Select all
<section(.*?)>(\s*)<title>(.*?)</title>((.|\s)*?)</section>
and replace with:
- Code: Select all
<bridgehead$1>$2<title>$3</title>$4</bridgehead>
Note that this won't work properly if you have nested sections.
e.g.
- Code: Select all
<section>
<section>
</section>
</section>
Regards,
Adrian