Hi,

In message "Re: String#split converts string args to regexes -- ?"
    on 02/07/11, Tom Sawyer <transami / transami.net> writes:

|but i am suprised with my #index results: it is about 4x as fast with a
|regexp versus a string.
|
|how is this possible? split is around 4x times faster with a string, but
|index is 4x as slow?

Remember String#split only searches for one character length string,
so that "split" only need to search and match the first byte for the
case.

regex match uses Boyer Moore search for exact string match (if it's
possible), whereas string match uses simple linear search.

							matz.