I have a string where I have to replace some content:
"...content... <a href='document/link/B1'>foo</a> ...content... <a href='document/link/B2'>bar</a> ..."
I'm looking for a clean way to obtain something like this:
"...content... <a href='document/link/23'>foo</a> ...content... <a href='document/link/24'>bar</a> ..."
Where '23' and '24' in the links are results of some processing that I did. So first I should be able to select the links, get their url (more specific: I need the B1 and B2) and then I have to perform some actions with e.g. B1 which results in '23' which I then have to insert back again in the string.
Is there a nice way to achieve this?