5 ms·
Actually, Python does use a Boyer-Moore-Horspool variant internally for substring matching (I'm not sure about Ruby, though). See: http://effbot.org/zone/stri
by amccollum 16y ago
Actually, Python does use a Boyer-Moore-Horspool variant internally for substring matching (I'm not sure about Ruby, though). See:
http://effbot.org/zone/stringlib.htm http://effbot.org/zone/stringlib.htm
Here's a link to the file in the Python SVN repo:
http://svn.python.org/view/python/trunk/Objects/stringlib/fastsearch.h?revision=77470&view=markup http://svn.python.org/view/python/trunk/Objects/stringlib/fa...
- burke 16y agoRuby 1.8.7 does too. Not sure about Oniguruma in 1.9 https://github.com/ruby/ruby/blob/ruby_1_8_7/regex.c#L2751-2789 https://github.com/ruby/ruby/blob/ruby_1_8_7/regex.c#L2751-2... EDIT: Looks like 1.9 does too: https://github.com/ruby/ruby/blob/ruby_1_9_2/regint.h#L281 https://github.com/ruby/ruby/blob/ruby_1_9_2/regint.h#L281