From: Mirko Viviani Date: 2009-07-18T00:54:14+09:00 Subject: Re: replacing verticle white spaces? --0016364d29e19eccf4046ee8cc6a Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Well... I just tried out with \r\n.... neverthless the solution is the same ;) 2009/7/17 Glenn Jackman > At 2009-07-17 08:11AM, "Mirko Viviani" wrote: > > 2009/7/17 George George > > > Any ideas on how to replace a verticle white space? > [...] > > puts s.gsub(/\r\n(\r\n)+/,"\r\n\r\n") > > I would write: > s.gsub(/((?:\r?\n){2})(?:\r?\n)*/, '\1') > > In Ruby, are newlines represented just as "\n" regardless of your > platform? > > -- > Glenn Jackman > Write a wise saying and your name will live forever. -- Anonymous > > --=20 -- Mirko Viviani -- GPG-PGP Public Key: 0xE4E8FAB1 Fingerprint: 14D3 A373 E926 7737 DF32 502B A4C4 1CE2 E4E8 FAB1 *********************************************** "=93Machines take me by surprise with great frequency.=94 A. Turing --0016364d29e19eccf4046ee8cc6a--