In Atom, If I activate regex mode on the search-and-replace tool, it can find newlines as \n
, but when I try to replace them, they're still there.
Is there no way to replace a newline-spanning string in Atom?
In the file menu, click Search and then Replace. In the Replace box, in the Find what section, type ^\r\n (five characters: caret, backslash 'r', and backslash 'n'). Leave the Replace with section blank unless you want to replace a blank line with other text.
Looks like Atom matches newlines as \r\n
but behaves inconsistently when replacing just the \n
with nothing.
So newlines seem to match \s+
and \r\n
, and only "half" of the line-ending matches \n
.
\n
with a string, nothing happens to the line-ending, but the string is appended to the next line\r
with a string, nothing happens at all, but the cursor advances.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With