From: Jamie Macey Date: 2006-11-25T09:35:04+09:00 Subject: Re: [QUIZ] DictionaryMatcher (#103) On 11/24/06, dblack@wobblini.net wrote: > What's the ruling on priority and "greediness"? In other words, > given: > > dm << "hi" > dm << "child" > > what would: > > dm =~ "children" > > give? Would it be different if you added "child" first? Or is there > a rule about finding the longest match? I'm doing the same thing a regexp does. In this case, both /hi|child/ =~ 'children' and /child|hi/ =~ 'children' return 0, so I'm returning the index of the first character in the string that matches the uber-regexp we're standing in for. - Jamie