From: Benjohn Barnes Date: 2006-03-11T19:36:26+09:00 Subject: Re: Help me understand why the Ruby block is slower than wit --Apple-Mail-14-557431005 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On 11 Mar 2006, at 02:13, George Ogata wrote: > Another speedup: replace: > > w.split(//).uniq.size == 11 > > with: > > w !~ /(.).*\1/ !? :) How on earth does that work? Every time I think I've sort of got the hang of regexp, they spring something new on me. I was also going to ask why everyone was doing "split( // )" instead of "split( '' )"? - oooh, coffee's ready... Cheers, Benjohn --Apple-Mail-14-557431005--