From: Alan Munn Date: 2009-07-21T05:05:05+09:00 Subject: Re: including newlines in a .sub In article <200907202136.26888.sepp00@web.de>, Sebastian Hungerecker wrote: > Am Montag 20 Juli 2009 21:30:06 schrieb Alan Munn: > > line = line.sub(/ /, '\n') > > In ruby "\n" is a newline, while '\n' is backslash followed by an n. Perfect. Thanks. I had tried that with my more complicated example (which included reference to capture groups from the regex) and it didn't work, but now I realise I need to concatenate the pieces together with a mix of single and double quotes to get it to work. Alan