Hi,
The following code snippet is causing CPU to max out on my local machine and
production servers. It looks fine on Expresso though.
Regex rgxVideo = new
Regex(@"<embed( \s+[a-z]+\s*=\s*(""[^""]*""|'[^']*'|[^\s]*))*\s+src=\s*( ""|')?http://www.g4tv.com/i?sv3?/(?<videokey>\d+ )(""|')?(\s+[a-z]+\s*=\s*(""[^""]*""|'[^']*'|[^\s]*))*\s*(/\s*>|>\s*</embed>)",
RegexOptions.Ig noreCase);
string strBody = "<embed name=\"VideoPla yer\"
src=\"http://localhost/lv3/26757\" width=\"480\" height=\"418\"
scale=\"ShowAll \" loop=\"loop\" menu=\"menu\" wmode=\"Window\ " quality=\"1\"
type=\"applicat ion/x-shockwave-flash\"></embed>" +
"<embed name=\"VideoPla yer\" src=\"http://localhost/lv3/19251\"
width=\"480\" height=\"418\" scale=\"ShowAll \" loop=\"loop\" menu=\"menu\"
wmode=\"Window\ " quality=\"1\"
type=\"applicat ion/x-shockwave-flash\"></embed>" +
"<embed name=\"VideoPla yer\" src=\"http://localhost/lv3/20202\"
width=\"480\" height=\"418\" scale=\"ShowAll \" loop=\"loop\" menu=\"menu\"
wmode=\"Window\ " quality=\"1\"
type=\"applicat ion/x-shockwave-flash\"></embed>" +
"<embed name=\"VideoPla yer\" src=\"http://localhost/lv3/16549\"
width=\"480\" height=\"418\" scale=\"ShowAll \" loop=\"loop\" menu=\"menu\"
wmode=\"Window\ " quality=\"1\"
type=\"applicat ion/x-shockwave-flash\"></embed>";
foreach (Match objMatch in rgxVideo.Matche s(strBody)) // loop
indefinitely here
{
}
TIA