Exemple #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);
		}
Exemple #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));
        }
Exemple #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));
            }
        }
Exemple #5
0
        public static string Evaluate(string replacement, Match match)
        {
            ReplacementEvaluator replacementEvaluator = new ReplacementEvaluator(match.Regex, replacement);

            return(replacementEvaluator.Evaluate(match));
        }
Exemple #6
0
 virtual public string Result(string replacement, Match match)
 {
     return(ReplacementEvaluator.Evaluate(replacement, match));
 }
Exemple #7
0
		public static string Evaluate (string replacement, Match match)
		{
			ReplacementEvaluator ev = new ReplacementEvaluator (match.Regex, replacement);
			return ev.Evaluate (match);
		}
Exemple #8
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));
        }
Exemple #9
0
 public virtual string Result(string replacement)
 {
     return(ReplacementEvaluator.Evaluate(replacement, this));
 }
		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);
		}