I have a field for which I would need to replace 
 values by CrLf.
I tried the following but \r\n is not recognized (unexpected character [\"\\r]. The only valid escape sequences in strings starting with [\"] are [\\\\] and [\\\"].).
The only way I found to get somewhere similar is by literally creating a new line in my script but even then, it create a \n value instead of \r\n (or at least it seems according to further manipulations).
{
"script": {
"lang": "painless",
"source": """
if(ctx.group?.MyField != null)
ctx.group.MyField.replace("
", "\r\n");
"""
}
}