C# 字段未找到编译的dll正则表达式异常
我遇到了这个错误,在谷歌上搜索了一个解决方案,但是没有 异常:未找到字段:“System.Text.RegularExpressions.Regex.internalMatchTimeout” 我的正则表达式是: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+&@#/%=~_|$?!:,
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库版本吗?哦,是的!谢谢,问题解决了!那我就把它作为答案吧!