I'm trying to add CSS styling to all hyperlinks unless it has a "donttouch" attribute.
E.g.
- Style this:
<a href="http://whatever.com">style me</a>
- Don't style this:
<a href="http://whatever.com" donttouch>don't style me</a>
Here's my preg_replace without the "donttouch" exclusion, which works fine.
preg_replace('/<a(.*?)href="([^"]*)"(.*?)>(.*?)<\/a>/','<a$1href="$2"$3><span style="color:%link_color%; text-decoration:underline;">$4</span></a>', $this->html)
I've looked all over the place, and would appreciate any help.