[Edited - Sorry Bart] I've looked at other answers but struggling to match this. I want to wrap an image tag where the src is the second attribute (after title) with a specific anchor tag that contains a link to the image found in the src from the image tag.
Example of img tag in string. This has been entered via tinymce wysiwyg and always adds title then src.
<img title="who_main_Layer_1.jpg" src="../../images/who_main_Layer_1.jpg" alt="who_main_Layer_1.jpg" width="380" height="268" />
I need to take all of these and wrap with the following href:
<a href="event:images/expand/image.jpg"><img src=”images/image.jpg” /></a>
The image src points to the thumbnail and the (Flash AS3 Event) pops up the full size version. Both images named the same just different folders.
Here is a full example of a string that would need the regex running against (Due to sensitive data I've substituted text for Lorem ipsum, but the layout is the same!):
<p>Lorem ipsum dolor sit amet</p>
<p> </p>
<p>Lorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit
ametLoremipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem
ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit amet</p>
<p> </p>
<p><img title="who_main_Layer_1.jpg" src="../../images/who_main_Layer_1.jpg"
alt="who_main_Layer_1.jpg" width="380" height="268" /></p>
<p> </p>
<p>Lorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem
ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum
dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor
sit
ametLorem ipsum dolor sit ametLorem ipsum dolor sit amet</p>
<p> </p>
<p><img title="who_main_Layer_1.jpg" src="../../images/who_main_Layer_1.jpg"
alt="who_main_Layer_1.jpg" width="380" height="268" /></p>`
Many thanks in advance, Marc