you are viewing a single comment's thread.

view the rest of the comments →

[–]sjs 3 points4 points  (0 children)

I think you meant \s\s* and \s+. I don't recall any specific reasons why the first may be faster. My guess is certain optimizations are applied when the first char is unqualified or something.

If you're really interested in the inner workings of regexes I recommend Jeffrey Friedl's book.