Struggling a bit with this one; I'm after correct syntax for throwing out line breaks with an empty string. The replacement doesn't seem to understand "\r\n" literal, and my attempts at using valid [php] regular expression syntax have failed silently. (NB: apparently not all valid regexps work in Squiz)
The problem with the replace modifier is, even though it uses the php preg_replace() function, the argument that you use actually gets stripped earlier in the code. So, when it gets to that function, what you entered probably isn't even there anymore.
I tried:
%globals_asset_contents_raw:7750^json_encode^replace:(\r?\n){2,}:---%
This returns nothing. But, when looking into the source of that modifier, and echoing out what the $toReplace and $replaceWith vars have I realize that it left me with the following regex:
(\n)+
Not exactly what I started with. So, somewhere earlier in the code the regex is getting stripped from the keyword.
I am going to submit a bug report for this.