Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 字段未找到编译的dll正则表达式异常_C#_Regex_Compilation - Fatal编程技术网

C# 字段未找到编译的dll正则表达式异常

C# 字段未找到编译的dll正则表达式异常,c#,regex,compilation,C#,Regex,Compilation,我遇到了这个错误,在谷歌上搜索了一个解决方案,但是没有 异常:未找到字段:“System.Text.RegularExpressions.Regex.internalMatchTimeout” 我的正则表达式是: TheExpressions.Add("ExtractURL", @"\b(?:(?:https?|ftp|file)://|www\.|ftp\.) (?:\([-A-Z0-9+&@#/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#/%=~_|$?!:,

我遇到了这个错误,在谷歌上搜索了一个解决方案,但是没有

异常:未找到字段:“System.Text.RegularExpressions.Regex.internalMatchTimeout”

我的正则表达式是:

TheExpressions.Add("ExtractURL", @"\b(?:(?:https?|ftp|file)://|www\.|ftp\.)
  (?:\([-A-Z0-9+&@#/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#/%=~_|$?!:,.])*
  (?:\([-A-Z0-9+&@#/%=~_|$?!:,.]*\)|[A-Z0-9+&@#/%=~_|$])");
要使用选项编译的代码:

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?

谢谢。

internalMatchTimeout字段似乎是.NET 4.5中的新字段。检查以确保您没有以某种方式混合.NET库版本。

internalMatchTimeout字段似乎是.NET 4.5中的新字段。你是在混用.NET库版本吗?哦,是的!谢谢,问题解决了!那我就把它作为答案吧!