Regular expressions. How to select this from post….
-
Hi All,
I want to be able to remove an image from a post to use in isolation. There are many scripts out there which make use of a reg exp to do this and they work great. BUT I have the following image code:
<a class="screenshot" rel="wp-content/uploads/2010/05/pop6_pv1.gif" href="?p=39"><img class="alignnone size-full wp-image-40" title="pop6" src="https://localhost/wp-content/uploads/2010/04/pop6.gif" alt="" width="196" height="137" /></a>
This has a hover over effent going on. But when I run this through this ~<img [^\>]*\ />~ I loose the class and rel aspects of the link. So I neex to select the whole string as above but being such a novice with reg ex I’m pretty much lost.
Can anyone help?
Sarah
- The topic ‘Regular expressions. How to select this from post….’ is closed to new replies.