public void setSubstitution(String substitution) { this.substitution = new PerlSubstitution(substitution); }
public String value(MatchResult mr) { TextBuffer dest = Replacer.wrap(new StringBuilder(mr.length())); appendSubstitution(mr, dest); return dest.toString(); }
public PerlSubstitution(String s) { Matcher refMatcher = new Matcher(refPtn); refMatcher.setTarget(s); queueEntry = makeQueue(refMatcher); }
public PerlSubstitution(String s) { Matcher refMatcher = new Matcher(refPtn); refMatcher.setTarget(s); queueEntry = makeQueue(refMatcher); }
public void setSubstitution(String substitution) { this.substitution = new PerlSubstitution(substitution); }
element.next = makeQueue(refMatcher); return element; } else return new PlainElement(refMatcher.target());
public String value(MatchResult mr) { TextBuffer dest = Replacer.wrap(new StringBuilder(mr.length())); appendSubstitution(mr, dest); return dest.toString(); }
public Replacer(Pattern pattern, String substitution, boolean isPerlExpr) { this.pattern = pattern; this.substitution = isPerlExpr ? new PerlSubstitution(substitution) : new DummySubstitution(substitution); }
element.next = makeQueue(refMatcher); return element; } else
public Replacer(Pattern pattern, String substitution, boolean isPerlExpr) { this.pattern = pattern; this.substitution = isPerlExpr ? new PerlSubstitution(substitution) : new DummySubstitution(substitution); }
public void setSubstitution(String s, boolean isPerlExpr) { substitution = isPerlExpr ? new PerlSubstitution(s) : new DummySubstitution(s); }
public void setSubstitution(String s, boolean isPerlExpr) { substitution = isPerlExpr ? new PerlSubstitution(s) : new DummySubstitution(s); }
/** * Replaces all matches this Matcher can find with replacement, as interpreted by PerlSubstitution (so $1 refers to * the first group and so on). * @param replacement the String to replace the first match with * @return this Matcher's String it operated on, after replacements */ public String replaceAll(String replacement) { TextBuffer tb = wrap(new StringBuilder(data.length)); Replacer.replace(this, new PerlSubstitution(replacement), tb); return tb.toString(); }
/** * Replaces all matches this Matcher can find with replacement, as interpreted by PerlSubstitution (so $1 refers to * the first group and so on). * @param replacement the String to replace the first match with * @return this Matcher's String it operated on, after replacements */ public String replaceAll(String replacement) { TextBuffer tb = wrap(new StringBuilder(data.length)); Replacer.replace(this, new PerlSubstitution(replacement), tb); return tb.toString(); }
/** * Replaces the first match this Matcher can find with replacement, as interpreted by PerlSubstitution (so $1 refers * to the first group and so on). Advances the search position for this Matcher, so it can also be used to * repeatedly replace the next match when called successively. * @param replacement the String to replace the first match with * @return this Matcher's String it operated on, after a replacement */ public String replaceFirst(String replacement) { TextBuffer tb = wrap(new StringBuilder(data.length)); Replacer.replace(this, new PerlSubstitution(replacement), tb, 1); return tb.toString(); }
/** * Replaces the first match this Matcher can find with replacement, as interpreted by PerlSubstitution (so $1 refers * to the first group and so on). Advances the search position for this Matcher, so it can also be used to * repeatedly replace the next match when called successively. * @param replacement the String to replace the first match with * @return this Matcher's String it operated on, after a replacement */ public String replaceFirst(String replacement) { TextBuffer tb = wrap(new StringBuilder(data.length)); Replacer.replace(this, new PerlSubstitution(replacement), tb, 1); return tb.toString(); }
/** * Replaces the first amount matches this Matcher can find with replacement, as interpreted by PerlSubstitution (so * $1 refers to the first group and so on). Advances the search position for this Matcher, so it can also be used to * repeatedly replace the next amount matches when called successively. * @param replacement the String to replace the first match with * @param amount the number of replacements to perform * @return this Matcher's String it operated on, after replacements */ public String replaceAmount(String replacement, int amount) { TextBuffer tb = wrap(new StringBuilder(data.length)); Replacer.replace(this, new PerlSubstitution(replacement), tb, amount); return tb.toString(); }
/** * Replaces the first amount matches this Matcher can find with replacement, as interpreted by PerlSubstitution (so * $1 refers to the first group and so on). Advances the search position for this Matcher, so it can also be used to * repeatedly replace the next amount matches when called successively. * @param replacement the String to replace the first match with * @param amount the number of replacements to perform * @return this Matcher's String it operated on, after replacements */ public String replaceAmount(String replacement, int amount) { TextBuffer tb = wrap(new StringBuilder(data.length)); Replacer.replace(this, new PerlSubstitution(replacement), tb, amount); return tb.toString(); }
public Matcher appendReplacement(StringBuffer sb, String replacement) { Replacer rep = internalPattern.replacer(replacement); Replacer.replaceStep(matcher, new PerlSubstitution(replacement), Replacer.wrap(sb)); return this; }
Replacer.replaceStep(matcher, new PerlSubstitution(replacement), Replacer.wrap(sb)); return this;