While answering another question, I wrote a regex to match all whitespace up to and including at most one newline. I did this using negative lookbehind for the \\R
\\R
The construct \R is a macro that surrounds the sub expressions into an atomic group (?> parts ).
\R
(?> parts )
That's why it won't break them apart.
A note: If Java accepts fixed alternations in a lookbehind, using \R is ok, but if the engine doesn't, this would throw an exception.