I need to transform href links into different kind of links (Confluence has its own system), and I'm getting close using an Ant build.xml file with replaceregexp, but not quite there yet.
Basically I need to start with links like this:
<a class="xref" href="../Test_Topic_2/Test_Topic_2.txt">Test Topic 2</a>
And turn them into this:
<ac:link><ri:page ri:content-title="Test_Topic_2" /></ac:link>
I've got an Ant build.xml file that works on the above link, but it doesn't work if the path starts with ../../ instead of ../
Since the best place to pick up the topic name would be from the 'Test_Topic_2.txt' entry, I'm wondering if there's a way with regular expressions to work backwards from '.txt', telling it to match everything from '.txt' back to the first slash it encounters, leave that in place, and replace the rest.
There may be some entirely different approach, if anyone has any ideas please let me know.
Thanks,