Thanks for the great module. I've been trying to use it in order to replace instances of >> in my content with the » ACSII code (to save non-technical editors from needing to remember how to write the special character into the content). Though I've successfully used Custom Filter to create a variety of other rules, this particular one has me stumped. The regex I've found that seems to work best in my own code for matching this is [>]{2} (though I've tried many other variations as well with no luck in Custom Filter). I'm not at all an expert in regex so there might be a better way. The pattern does work though in my test PHP script (however the same rule in Custom Filter has no effect... have ensured it is not cached, resaved content, etc):

$original_string = 'Step 1 >> Step 2';
$string = 'Step 1 >> Step 2';

$string = preg_replace("/[>]{2}/", '»', $string);

echo 'Original string: '. $original_string . '<br />';
echo 'Modified string: '. $string;

I also tried the dev version to see if it would help before asking this question, but it badly broke the module's database tables, so still trying to get that straightened out.
Thanks in advance for any help :)

Comments

dnewkerk’s picture

Title: Cannot get search/replace for >> to work » How to replace >> with &raquo; character
Status: Active » Closed (fixed)

A bit more head scratching and I figured it out :)

In case it helps anyone... I needed to use /(&gt;){2}/ since it seems the character was already converted from the original > by the time the filter was applied.