Pchp.Library.PerlRegex.Match.Result C# (CSharp) 메소드

Result() 공개 메소드

Returns the expansion of the passed replacement pattern. For example, if the replacement pattern is ?$1$2?, Result returns the concatenation of Group(1).ToString() and Group(2).ToString().
public Result ( string replacement ) : string
replacement string
리턴 string
        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);
        }