I wouldn't bring /o into the equation. It makes a regex "sterile" which wouldn't be helpful if this were in a function where the strings are arguments.
You haven't provided any data for failing cases. The further the smaller string is from the beginning of the bigger string, the slower index() will be.
Jeff japhy Pinyan,
P.L., P.M., P.O.D, X.S.:
Perl,
regex,
and perlhacker How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
Comment on Re^3: Regex Start Anchor with variables