Lines Matching defs:replacement

640      * Returns a literal replacement <code>String</code> for the specified
644 * as a literal replacement <code>s</code> in the
651 * @return A literal string replacement
681 * <li><p> It appends the given replacement string to the string buffer.
690 * <p> The replacement string may contain references to subsequences
701 * example, then passing the replacement string <tt>"$2bar"</tt> would
703 * sign (<tt>$</tt>) may be included as a literal in the replacement
707 * the replacement string may cause the results to be different than if it
708 * were being treated as a literal replacement string. Dollar signs may be
710 * backslashes are used to escape literal characters in the replacement
731 * @param replacement
732 * The replacement string
741 * If the replacement string refers to a named-capturing
745 * If the replacement string refers to a capturing group
748 public Matcher appendReplacement(StringBuffer sb, String replacement) {
758 while (cursor < replacement.length()) {
759 char nextChar = replacement.charAt(cursor);
762 nextChar = replacement.charAt(cursor);
769 // this "$" is the last character in replacement
772 nextChar = replacement.charAt(cursor);
777 while (cursor < replacement.length()) {
778 nextChar = replacement.charAt(cursor);
814 if (cursor >= replacement.length()) {
817 int nextDigit = replacement.charAt(cursor) - '0';
868 * pattern with the given replacement string.
873 * is replaced in the result by the replacement string. The replacement
878 * the replacement string may cause the results to be different than if it
879 * were being treated as a literal replacement string. Dollar signs may be
881 * backslashes are used to escape literal characters in the replacement
885 * <tt>"aabfooaabfooabfoob"</tt>, and the replacement string
893 * @param replacement
894 * The replacement string
897 * by the replacement string, substituting captured subsequences
900 public String replaceAll(String replacement) {
906 appendReplacement(sb, replacement);
917 * pattern with the given replacement string.
922 * is replaced in the result by the replacement string. The replacement
927 * the replacement string may cause the results to be different than if it
928 * were being treated as a literal replacement string. Dollar signs may be
930 * backslashes are used to escape literal characters in the replacement
934 * <tt>"zzzdogzzzdogzzz"</tt>, and the replacement string
942 * @param replacement
943 * The replacement string
945 * subsequence by the replacement string, substituting captured
948 public String replaceFirst(String replacement) {
949 if (replacement == null)
950 throw new NullPointerException("replacement");
955 appendReplacement(sb, replacement);