Function: erc-replace-regexp-in-string

erc-replace-regexp-in-string is a function alias for replace-regexp-in-string, defined in subr.el.gz.

This function is obsolete since 28.1; use replace-regexp-in-string instead.

Signature

(erc-replace-regexp-in-string REGEXP REP STRING &optional FIXEDCASE LITERAL SUBEXP START)

Documentation

Replace all matches for REGEXP with REP in STRING.

Return a new string containing the replacements.

Optional arguments FIXEDCASE, LITERAL and SUBEXP are like the arguments with the same names of function replace-match. If START is non-nil, start replacements at that index in STRING, and omit the first START characters of STRING from the return value.

REP is either a string used as the NEWTEXT arg of replace-match or a function. If it is a function, it is called with the actual text of each match, and its value is used as the replacement text. When REP is called, the match data are the result of matching REGEXP against a substring of STRING, the same substring that is the actual text of the match which is passed to REP as its argument.

To replace only the first match (if any), make REGEXP match up to \' and replace a sub-expression, e.g.
  (replace-regexp-in-string "\\\\(foo\\\\).*\\\\\\='" "bar" " foo foo" nil nil 1)
    => " bar foo"

Aliases

s-replace-regexp erc-replace-regexp-in-string (obsolete since 28.1) mh-replace-regexp-in-string (obsolete since 29.1) icalendar--rris (obsolete since 27.1)