From: Paul Mckibbin Date: 2008-03-20T09:17:08+09:00 Subject: Re: regexp conditional Robert Klemme wrote: >> I am waiting though for a regexp solution, > Even 2 regexps: > Cheers > > robert Robert, How fixed is the input. If it is always of the same format, then what about: input = '111|"aaaa" bbbbb|c' output=input.gsub(/\"/,'""').gsub(/(.*)\|(.*)\|(.*)/,'\1|"\2"|\3') Mac -- Posted via http://www.ruby-forum.com/.