View Single Post
Old 11-01-2009, 09:54 PM   #5 (permalink)
Rhinos
The Wanderer
 
Join Date: Aug 2009
Posts: 17
Thanks: 0
Rhinos is on a distinguished road
Default

Your right. I've tried to work mine a little since when I tried yours on the javascript tester page it didn't work with the following information:

Regexp: (<a[^>]*>)?(<acronym[^>]*>(.*?)</acronym>)(</a>)?
Subject string: hey <a href="test"><acronym>yo</acronym> yo <acronym>bob</acronym></a> what's up? <a href="test">nothing</a>
Replacement text: $1$3$4

Code:
$the_content = preg_replace('~(<a[^>]*>)?(<acronym[^>]*>(.*?)</acronym>)(</a>)?~i', '$1$3$4', $the_content);
Let me know what you think.
Rhinos is offline  
Reply With Quote
The Following User Says Thank You to Rhinos For This Useful Post:
unitechy (11-02-2009)