RegExp performance in IE

RegExp performance in IE


Hi All,
I am not sure if this is the right place to post, please excuse me
it's not
Bumpped into one problem when I tried to generate around 5000 select
options using jQuery in IE, it simply freezes, I was able to isolate
the problem down a regular expression used for picking up the html
tags, (the particular regular expression had to deal with around 100K
of text, and it appears to be a killer for IE).
/^[^<]*(<(.|\s)+>)[^>]*$/
The culprit was in fact in (.|\s) and the way IE handles it,
some googling gave a result about how to write the same thing in a
slightly different way
(http://blog.stevenlevithan.com/archives/xregexp-named-capture)
/^[^<]*(<[\S\s]+>)[^>]*$/,
And the performance was way better than it was (only took a fraction
of a second todo something that previously took I don't know how long)
My guess is that it's something to do with the way IE's re engine
handles | ...
Anyhow, hope this helps, keep up the great work guys :)
Lei