comparison lisp/subr.el @ 65058:de7df04c6d6b

(replace-regexp-in-string): Doc fix.
author Richard M. Stallman <rms@gnu.org>
date Sat, 20 Aug 2005 21:48:51 +0000
parents 3aa61588445b
children aad2616355a4
comparison
equal deleted inserted replaced
65057:d92890473bd3 65058:de7df04c6d6b
2165 Optional arguments FIXEDCASE, LITERAL and SUBEXP are like the 2165 Optional arguments FIXEDCASE, LITERAL and SUBEXP are like the
2166 arguments with the same names of function `replace-match'. If START 2166 arguments with the same names of function `replace-match'. If START
2167 is non-nil, start replacements at that index in STRING. 2167 is non-nil, start replacements at that index in STRING.
2168 2168
2169 REP is either a string used as the NEWTEXT arg of `replace-match' or a 2169 REP is either a string used as the NEWTEXT arg of `replace-match' or a
2170 function. If it is a function it is applied to each match to generate 2170 function. If it is a function, it is called with the actual text of each
2171 the replacement passed to `replace-match'; the match-data at this 2171 match, and its value is used as the replacement text. When REP is called,
2172 point are such that match 0 is the function's argument. 2172 the match-data are the result of matching REGEXP against a substring
2173 of STRING.
2173 2174
2174 To replace only the first match (if any), make REGEXP match up to \\' 2175 To replace only the first match (if any), make REGEXP match up to \\'
2175 and replace a sub-expression, e.g. 2176 and replace a sub-expression, e.g.
2176 (replace-regexp-in-string \"\\\\(foo\\\\).*\\\\'\" \"bar\" \" foo foo\" nil nil 1) 2177 (replace-regexp-in-string \"\\\\(foo\\\\).*\\\\'\" \"bar\" \" foo foo\" nil nil 1)
2177 => \" bar foo\" 2178 => \" bar foo\"