I want my RegExp parameter to be anything but a new line
\r?\n
This should do it:
/(?:[^\r\n]|\r(?!\n))/g
This matches any character except \r and \n , or one \r followed by \n .
\r
\n
you can use a negative delimiter!
so (?!(\r|\n))
(?!(\r|\n))
try
or is it possible
.+?(?!(\r|\n))
As an alternative suggestion, why not avoid regexp?
var newText = oldText.replace("\r","").replace("\n","");
This will return a string deleting all instances of \r and \n