From: Robert Klemme Date: 2012-10-06T20:38:14+09:00 Subject: Re: Regular Expression Help On Sat, Oct 6, 2012 at 12:25 PM, wrote: > Am 06.10.2012 12:12, schrieb Robert Klemme: > >> On Sat, Oct 6, 2012 at 1:21 AM, wrote: >> >>> 1.9.3-p194 :001 > text = '"--- this is a string ---" = "--- this is a >>> string >>> ---";' >>> => "\"--- this is a string ---\" = \"--- this is a string ---\";" >>> 1.9.3-p194 :002 > text.scan(/"(.*?)" = "(.*?)"/).flatten >>> => ["--- this is a string ---", "--- this is a string ---"] >> >> I'd rather use an approach which explicitly includes the "=" sign > > ??? > > It does. Right you are. I let myself irritate by your usage of String#scan. Sorry for that. I do not think this is a case for #scan though since according to the OP's description the String only contains one "assignment". So it's either "match" or "don't match". Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/