If you're reading that line by line, you can't easily back up to make the replacement.
If you slurp the input, you need to save multiple matches for "affiliation" tags in a data structure and make another pass.
If your input is valid XML, then one of the XML modules may be the best approach.
After Compline,
Zaxo
In reply to Re: find and replace
by Zaxo
in thread find and replace
by texuser74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |