D
Danny Ni
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.IgnoreCase);
string strBody = "<embed name=\"VideoPlayer\"
src=\"http://localhost/lv3/26757\" width=\"480\" height=\"418\"
scale=\"ShowAll\" loop=\"loop\" menu=\"menu\" wmode=\"Window\" quality=\"1\"
type=\"application/x-shockwave-flash\"></embed>" +
"<embed name=\"VideoPlayer\" src=\"http://localhost/lv3/19251\"
width=\"480\" height=\"418\" scale=\"ShowAll\" loop=\"loop\" menu=\"menu\"
wmode=\"Window\" quality=\"1\"
type=\"application/x-shockwave-flash\"></embed>" +
"<embed name=\"VideoPlayer\" src=\"http://localhost/lv3/20202\"
width=\"480\" height=\"418\" scale=\"ShowAll\" loop=\"loop\" menu=\"menu\"
wmode=\"Window\" quality=\"1\"
type=\"application/x-shockwave-flash\"></embed>" +
"<embed name=\"VideoPlayer\" src=\"http://localhost/lv3/16549\"
width=\"480\" height=\"418\" scale=\"ShowAll\" loop=\"loop\" menu=\"menu\"
wmode=\"Window\" quality=\"1\"
type=\"application/x-shockwave-flash\"></embed>";
foreach (Match objMatch in rgxVideo.Matches(strBody)) // loop
indefinitely here
{
}
TIA
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.IgnoreCase);
string strBody = "<embed name=\"VideoPlayer\"
src=\"http://localhost/lv3/26757\" width=\"480\" height=\"418\"
scale=\"ShowAll\" loop=\"loop\" menu=\"menu\" wmode=\"Window\" quality=\"1\"
type=\"application/x-shockwave-flash\"></embed>" +
"<embed name=\"VideoPlayer\" src=\"http://localhost/lv3/19251\"
width=\"480\" height=\"418\" scale=\"ShowAll\" loop=\"loop\" menu=\"menu\"
wmode=\"Window\" quality=\"1\"
type=\"application/x-shockwave-flash\"></embed>" +
"<embed name=\"VideoPlayer\" src=\"http://localhost/lv3/20202\"
width=\"480\" height=\"418\" scale=\"ShowAll\" loop=\"loop\" menu=\"menu\"
wmode=\"Window\" quality=\"1\"
type=\"application/x-shockwave-flash\"></embed>" +
"<embed name=\"VideoPlayer\" src=\"http://localhost/lv3/16549\"
width=\"480\" height=\"418\" scale=\"ShowAll\" loop=\"loop\" menu=\"menu\"
wmode=\"Window\" quality=\"1\"
type=\"application/x-shockwave-flash\"></embed>";
foreach (Match objMatch in rgxVideo.Matches(strBody)) // loop
indefinitely here
{
}
TIA