Not found exception from field with compiled regular expression dll

I am having problems with this error and a solution was found for Google, but it is not.

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

My regex 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 parameters:

 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.

+2
source share
1 answer

It seems that the innerMatchTimeout field is new in .NET 4.5. Make sure you do not mix .NET versions in any way.

+2
source

Source: https://habr.com/ru/post/1493145/


All Articles