Field not found exception with compiled dll regular expression

不想你离开。 提交于 2019-12-22 12:07:15

问题


I'm having trouble with this error and been searched for a solution on google but there aren't any.

Exception: Field not found: 'System.Text.RegularExpressions.Regex.internalMatchTimeout'.

My regular expression is :

TheExpressions.Add("ExtractURL", @"\b(?:(?:https?|ftp|file)://|www\.|ftp\.)
  (?:\([-A-Z0-9+&@#/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#/%=~_|$?!:,.])*
  (?:\([-A-Z0-9+&@#/%=~_|$?!:,.]*\)|[A-Z0-9+&@#/%=~_|$])");

Code to compile with options:

CI[Cnt++] = new RegexCompilationInfo((string)de.Value,        // the reg. ex pattern
                                                 RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled,   // Options to specify
                                                 (string)de.Key,          // name of the pattern
                                                 "TheRegularExpressions", // name space name
                                                 true);                  // Public?

Thanks.


回答1:


It seems that the internalMatchTimeout field is new in .NET 4.5. Check to make sure that you aren't somehow mixing .NET library versions.



来源:https://stackoverflow.com/questions/8456779/field-not-found-exception-with-compiled-dll-regular-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!