I need a regex expression that substitutes
\\n in a source code written in C to
it is NOT in a function call.
func("str", 1, &addrs); \\n printf("hello"); →
func("str", 1, &addrs); \n printf("hello");
it is NOT in a string
"hello" \\n "there"; →
"hello" \n "there"
As to why I have stray
\\n in my code I don't want to say. I just wanna get rid of them.
If I understood correctly something like
func("str\\ntest") should stay as is and not be replaced.
Given that I can't see an option with a regex or sed. I think you'll have to do clean by hand or craft something to parse line by line and replace if the \n is outside a string or function call (even that sounds tricky).