From: Raul Parolari Date: 2007-11-24T03:36:06+09:00 Subject: Re: New at regexp and Ruby need help on parsing a string. When I typed the final solution, an unwanted '}' got in. I post again the code: str.scan(/ (and|not) (.*?) (?= (\b(and|not)\b)|$) /x) do |k, v| h[k.to_sym].push(v.strip) end Regards Raul -- Posted via http://www.ruby-forum.com/.