Author: Frenz | Posted on: 7/6/2008 8:11:23 PM | Views : 259

Hi,

I'm facing a performance issue with the following code:


MatchCollection match = regex.Matches(strInput);
int i = match.Count;          //This line is consuming 98% of CPU time

for(int j =0;j<i;j++)
{
....
....
}

I also tried the following alternative to avoid match.Count

for (match = regex.Match(strInput); match.Success; match = match.NextMatch())
{
...
...
}

This also doesn't make any difference. It would be great if anyone could give me an alternate solution.


Thanks & Regards,
Frenz
...

Go to the complete details ...