How can I use a 'New Line' Character as the replacement String(/Character) in the Replace operator?
Background:
I need to elminiate empty lines from an attribute.
So, replace multiple consecutive 'New Lines' by one 'New Line'.
My search so far is
(?s)((\n*)(\n))
which locates those multple empty lines, with an replacement string of '$3' .
I could have used also a simple '\n{2,}'.
But regardsless of what I do I can get a 'new Line' (or any other special character) as an replacement string.
Neither '\n' or '\013' worked. (Also not '\t' for test purposes.)
I have read through http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html already, but there is nothing related to replacement strings an any limitations.
Any ideas appreciated.