From: Logan Capaldo Date: 2007-08-29T09:35:17+09:00 Subject: Re: gsub help On 8/28/07, hurcan solter wrote: > Hi there; > this is more of a regexp question but I'de be happy if you help me > since i am doing it in ruby. > i want to beautify some line by inserting or removing some space > around the operators like = or == > so i came up with an expression like; > > line.gsub!(/\s*([=]+)\s*/ ,' \1 ') > > But it applies every = on the line ofc, but I want to exclude > expressions between quotation marks ("sth=sth") or regexp (/sth=sth/). > I've tried negated character classes and such to no avail.How can I do > this? This is not a job for regexps. This is a job for a ruby parser. > Any help would be greatly appreciated... > Hurcan > > >