From: Harry Date: 2007-04-30T12:09:45+09:00 Subject: Re: problem replacing newlines in regexp On 4/30/07, Dan Zwell wrote: > Harry wrote: > > On 4/30/07, Mike Steiner wrote: > >> I'm trying to do a gsub ( "\n" , " " ) but none of the newlines are > >> replaced. Is there something special I have to do for newlines? (If it > >> makes > >> a difference, I'm running under Windows.) > >> > >> > > > > Try gsub!( "\n" , " " ) > > > > Harry > > > > You've probably gotta specify the multiline match option (the /m at the > end): > line.gsub!(/\n/m, " ") > > Dan > > I just noticed the subject said regexp, not string. oops. Mike, would you post some code? It will make it easier to understand what you are trying to do. Harry -- http://www.kakueki.com/ruby/list.html A Look into Japanese Ruby List in English