public virtual string Result(string replacement)
{
RegexReplacement repl;
if (replacement == null)
throw new ArgumentNullException(nameof(replacement));
if (_regex == null)
throw new NotSupportedException(SR.NoResultOnFailed);
repl = (RegexReplacement)_regex._replref.Get();
if (repl == null || !repl.Pattern.Equals(replacement))
{
repl = RegexParser.ParseReplacement(replacement, _regex.caps, _regex.capsize, _regex.capnames, _regex.roptions);
_regex._replref.Cache(repl);
}
return repl.Replacement(this);
}