I have a piece of UTF-8 encoded HTML that I need to get one file reference out of, then I need to change it entirely using said file reference.
This is the starting code:
<object width="250" height="20" data="player.swf" type="application/x-shockwave-flash">
<param name="data" value="player.swf" />
<param name="flashvars" value="file=TEST.MP3" />
<param name="src" value="player.swf" />
</object>
As you can see, it's an object tag that contains a reference to a file, and a flash player.
This is the code that I require:
<p><a href="TEST.MP3">TEST.MP3</a></p>
I've tried getting the file reference out first, then just replacing the object part entirely with an a tag, but this just replaces all object tags and not just the one I need.
The easiest way would be ofcourse to just 'replace' the object tag with an a tag, but I don't know how to do a Regex to find and replace everything 'around' the file you need.
What would be the best way to do this?