I have the following line of code in a HTML file (or something similar):
...
<a href="#SCRIPT_NAME#?a=b&id=a/b/c/d">Link Content</a>
...
I need to be able to extract the a/b/c/d
part of the href
and convert the link to something like:
<a href="/lookup?id=a/b/c/d">Link Content</a>
Ideally I'd like to be able to do this with regex, but most of the regex stuff I've seen for XSLT on StackOverflow seems to require XPath 2.
Ah yes... I'm using SimpleXML/DomDocument on PHP5.3 to apply the stylesheet which I believe doesn't support v2 xslt.
I think I could do string replacement to lose the first part, but I'd like to have a pattern match to extract it.
Any thoughts?