public void setSubstitution(String substitution) { this.substitution = new PerlSubstitution(substitution); }
public void setSubstitution(String substitution) { this.substitution = new PerlSubstitution(substitution); }
public Replacer(Pattern pattern, String substitution, boolean isPerlExpr) { this.pattern = pattern; this.substitution = isPerlExpr ? new PerlSubstitution(substitution) : new DummySubstitution(substitution); }
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;