Q:

Match all control characters but line break \n

Is there a way to write a regex that matches any control character except the line break "\n"?
I can write a regex to catch any of the control characters like so:
/\p{Cc}/

A:

This should do it:
/(?!\n)\p{Cc}/

Negative lookahead, shouldn't match line breaks

