I know this is pedantic, but index() doesn't stop looking after it fails to find the target at position 0 of the string. The regex does. The regex fails very fast. Add a \Q...\E and an /i modifier, and you have a perfectly reasonable solution. And, as my solution above showed, you can get more bang for your buck.
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