From: Matthew Rudy Jacobs Date: 2008-06-30T05:19:13+09:00 Subject: Re: Statistician I (#167) Matthew Moss wrote: > > def initialize(str) > patt = str.gsub(/\[(.+?)\]/, '(?:\1)?').gsub(/<(.+?)>/, '(.+?)') > @pattern = Regexp.new('^' + patt + '$') > @fields = nil > end does the rule string not need to be regexp escaped somehow if it's gonna be directly Regexp.new'ed? I fear a rule with something like "You run away[ from ] (you coward)" would break this approach. Matthew Rudy -- Posted via http://www.ruby-forum.com/.