示例#1
0
		public virtual string Replace (Regex regex, string input, string replacement, int count, int startat)
		{
			ReplacementEvaluator ev = new ReplacementEvaluator (regex, replacement);
			if (regex.RightToLeft)
				return RTLReplace (regex, input, new MatchEvaluator (ev.Evaluate), count, startat);
			else
				return LTRReplace (regex, input, new MatchAppendEvaluator (ev.EvaluateAppend), count, startat, ev.NeedsGroupsOrCaptures);
		}
示例#2
0
        public virtual string Replace(Regex regex, string input, string replacement, int count, int startat)
        {
            ReplacementEvaluator replacementEvaluator = new ReplacementEvaluator(regex, replacement);

            if (regex.RightToLeft)
            {
                return(RTLReplace(regex, input, replacementEvaluator.Evaluate, count, startat));
            }
            return(LTRReplace(regex, input, replacementEvaluator.EvaluateAppend, count, startat, replacementEvaluator.NeedsGroupsOrCaptures));
        }
        public virtual string Replace(Regex regex, string input, string replacement, int count, int startat)
        {
            ReplacementEvaluator replacementEvaluator = new ReplacementEvaluator(regex, replacement);

            if (regex.RightToLeft)
            {
                return(this.RTLReplace(regex, input, new MatchEvaluator(replacementEvaluator.Evaluate), count, startat));
            }
            return(this.LTRReplace(regex, input, new BaseMachine.MatchAppendEvaluator(replacementEvaluator.EvaluateAppend), count, startat, replacementEvaluator.NeedsGroupsOrCaptures));
        }
示例#4
0
        public virtual string Replace(Regex regex, string input, string replacement, int count, int startat)
        {
            ReplacementEvaluator ev = new ReplacementEvaluator(regex, replacement);

            if (regex.RightToLeft)
            {
                return(RTLReplace(regex, input, new MatchEvaluator(ev.Evaluate), count, startat));
            }
            else
            {
                return(LTRReplace(regex, input, new MatchAppendEvaluator(ev.EvaluateAppend), count, startat, ev.NeedsGroupsOrCaptures));
            }
        }
示例#5
0
        public static string Evaluate(string replacement, Match match)
        {
            ReplacementEvaluator replacementEvaluator = new ReplacementEvaluator(match.Regex, replacement);

            return(replacementEvaluator.Evaluate(match));
        }
示例#6
0
 virtual public string Result(string replacement, Match match)
 {
     return(ReplacementEvaluator.Evaluate(replacement, match));
 }
示例#7
0
文件: replace.cs 项目: nlhepler/mono
		public static string Evaluate (string replacement, Match match)
		{
			ReplacementEvaluator ev = new ReplacementEvaluator (match.Regex, replacement);
			return ev.Evaluate (match);
		}
示例#8
0
文件: regex.cs 项目: ForNeVeR/pnet
        public string Replace(string input, string replacement, int count, int startat)
        {
            ReplacementEvaluator ev = new ReplacementEvaluator(this, replacement);

            return(Replace(input, new MatchAppendEvaluator(ev.EvaluateAppend), count, startat));
        }
示例#9
0
 public virtual string Result(string replacement)
 {
     return(ReplacementEvaluator.Evaluate(replacement, this));
 }
示例#10
0
		public string Replace (string input, string replacement, int count, int startat) {
			ReplacementEvaluator ev = new ReplacementEvaluator (this, replacement);
			return Replace (input, new MatchAppendEvaluator (ev.EvaluateAppend), count, startat);
		}