1

I am currently using Low Replace to clean up content exported from EE to be used as a JSON object. This means cleaning up new lines, spaces, escaping quotes and backslashes. I am able to get the first three to work. However I cannot seem to find a way to escape a backslash.

I've even tried to map it as a replacement option in pi.low_replace.php

private $_map = array(
        'SPACE'   => ' ',
        'QUOTE'   => '"',
        'NEWLINE' => "\n",
        'PIPE'    => '|',
        'BACKSLASH'    => "\\"
    );

No luck.

1 Answer 1

1

Figured it out...

'BACKSLASH'    => "\/"

Also found out I didn't need to modify the plugin.

{exp:low_replace multiple='yes' regex='yes' find='\/|QUOTE|NEWLINE|/\t/' replace='\|\QUOTE|SPACE'}

Works like a charm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.