From: Daniel DeLorme Date: 2007-06-15T09:17:37+09:00 Subject: Re: Characters and strings oddness Stefan Kruger wrote: > line = ' a string "properly \"quoted\" that ends" here ' > quoted = '"properly \"quoted\" that ends"' > > If Ruby had the same regexes as Perl, I'd say something like > > line.gsub!(/^\s*(\".*?(? > and have my quoted string pop out in $1. In fact, TextMate groks that > regex, too. How is that supposed to work? With the initial anchor there's no way that regexp would ever match even if ruby supported look-behind. I suggest this: /"((?:\\.|[^\\])+)"/ Daniel