Implementing RegEx Timeout in .NET 4

后端 未结 4 1708
情歌与酒
情歌与酒 2020-12-09 00:33

Platform: Silverlight 4, .NET 4

With the .NET 4.5 Developer preview the RegEx class has been enhanced to allow setting of a Timeout value which would prevent the Reg

4条回答
  •  不思量自难忘°
    2020-12-09 00:48

    It is not that simple - but it can be done using two threads with the first doing the regex, the second killing the first thread if itruns too long. This is problematic in itself, though.

提交回复
热议问题