System.Text.RegularExpressions.Regex.MatchTimeout Property

Gets the time-out interval of the current instance.

Syntax

[System.MonoTODO("Timeouts are ignored.")]
public TimeSpan MatchTimeout { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The Regex.MatchTimeout property defines the approximate maximum time interval for a System.Text.RegularExpressions.Regex instance to execute a single matching operation before the operation times out. The regular expression engine throws a System.Text.RegularExpressions.RegexMatchTimeoutException exception during its next timing check after the time-out interval has elapsed. This prevents the regular expression engine from processing input strings that require excessive backtracking. For more information, see Backtracking and Best Practices for Regular Expressions in the .NET Framework.

This property is read-only. You can set its value explicitly for an individual System.Text.RegularExpressions.Regex object by calling the Regex.#ctor(string, RegexOptions, TimeSpan) constructor; and you can set its value for all System.Text.RegularExpressions.Regex matching operations in an application domain by calling the AppDomain.SetData(string, object) method and providing a value for the "REGEX_DEFAULT_MATCH_TIMEOUT" property. If you do not explicitly set a time-out interval, the default value Regex.InfiniteMatchTimeout is used, and matching operations do not time out.

Requirements

Namespace: System.Text.RegularExpressions
Assembly: System (in System.dll)
Assembly Versions: 4.0.0.0