internal Regex(string pattern, RegexOptions options, TimeSpan matchTimeout, CultureInfo?culture) { culture ??= GetTargetCulture(options); Init(pattern, options, matchTimeout, culture); if ((options & RegexOptions.NonBacktracking) != 0) { // If we're in non-backtracking mode, create the appropriate factory. factory = SymbolicRegexRunner.CreateFactory(_code, options, matchTimeout, culture); _code = null; } else if (RuntimeFeature.IsDynamicCodeCompiled && UseOptionC()) { // If the compile option is set and compilation is supported, then compile the code. factory = Compile(pattern, _code, options, matchTimeout != InfiniteMatchTimeout); _code = null; } }
/// <summary>Initializes the factory.</summary> /// <param name="runner">Shared runner instance.</param> public SymbolicRegexRunnerFactory(SymbolicRegexRunner runner) => _runner = runner;