On Thu, 01 Jan 2004 12:46:54 -0800, GGarramuno wrote: > ts <decoux / moulon.inra.fr> wrote in message news:<200401011438.i01Ecb824151 / moulon.inra.fr>... >> >>>>> "G" == GGarramuno <GGarramuno / aol.com> writes: >> >> G> I am obviously missing some other method that =~ uses, right? >> >> Yes, internally ruby is optimized to call directly the C function rather >> than calling the ruby method. >> > > Hmm... so, is there a way to overload/redefine it from ruby? > Also, how do you find out about the existance of this optimization? > By browsing the ruby C code? Or are there some docs available > somewhere? Look here if you want to overwrite $1..$9, $', $`, $+ http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/86167 BTW: Why are you interested in overloading the regexp methods? Is it because you are writing your own regexp engine? -- Simon Strandgaard