From: Logan Capaldo Date: 2006-04-13T03:25:45+09:00 Subject: Re: First script seems slow - What's a better way to write t --Apple-Mail-9--944585908 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Apr 12, 2006, at 2:19 PM, Mark Volkmann wrote: > On 4/12/06, Daniel Berger wrote: >> >> Just a quick note - precompiling the regular expressions might >> help here, too. > > How do you do that in Ruby? > You use this idiom: class SomeClass def initialize @some_re = /some_re/ end def some_method # do stuff with @some_re end end --Apple-Mail-9--944585908--