I tried to replace the “\n” to the “space”, so I wrote the rule as below:
rule "remove newline"
when
has_field("message")
then
let new_message = regex_replace("\\n", to_string($message.message), " ", true);
set_field("message", new_message);
end
Poking around I cam across this post - maybe it will help? IT talks about replacing the \n and \r separately… even though you haven’t mentioned the \r…