Possible Duplicate:
Implementing RegEx Timeout in .NET 4
Regex regexpr = new Regex(anchorPattern[item.Key], RegexOptions.Singleline, TimeSpan.FromMilliseconds(10));
“System.Text.RegulerExpression.Regex” does not contain a constructer that takes 3 arguments.
Note :The error is in the framework 4. if you use the framework 4.5 you won’t encounter this error.
But i have been using framework 4 and I have to set timeout regexpr. What is the remedy to this ?
There is no such constructor as the one you are using in .NET 4. Take a look at documentation page; the only options for constructor are:
EDIT
You can use a Task to run the regex and
Waitmethod to pass the timeout. Something like this should do the work: