From: Aa Wilson Date: 2009-04-10T21:52:00+09:00 Subject: Re: regex woes with breaklines Andrew Timberlake wrote: > s = "test\r\ntest
\r\ntest\ntest\rtest
\ntest" > s.gsub(/(?:
)*(?:\r\n|\n|\r)/, "
\n") > #=> "test
\ntest
\ntest
\ntest
\ntest
\ntest" Thanks a million. It feels like a waste replacing something that's already there, but I suppose that's just my conceptions of real life getting in the way of my abstractions. I was actually hoping that '$' (or possibly '$$?') would cover all the CR/LF/CRLF cases for me, was I mistaken about that? -- Posted via http://www.ruby-forum.com/.