11-01-2009, 09:54 PM
|
#5 (permalink)
|
|
The Wanderer
Join Date: Aug 2009
Posts: 17
Thanks: 0
|
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.
|
|
|
|