The index() isn't really all that much faster than a regexp. BrowserUK was testing this once, I played with the benchmark and noticed that the index test was a percentage point faster. At this point I'd prefer people just recommend the regexp since it is as fast and is notationally less complex.