Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
1697159c
Commit
1697159c
authored
Mar 14, 2000
by
Dave Love
Browse files
(replace-regexp-in-string): Renamed from
replace-regexps-in-string. Doc fix.
parent
9c763cca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
lisp/subr.el
lisp/subr.el
+7
-3
No files found.
lisp/subr.el
View file @
1697159c
...
...
@@ -1196,8 +1196,8 @@ Unless optional argument INPLACE is non-nil, return a new string."
(
aset
newstr
i
tochar
)))
newstr
))
(
defun
replace-regexp
s
-in-string
(
regexp
rep
string
&optional
fixedcase
literal
subexp
start
)
(
defun
replace-regexp-in-string
(
regexp
rep
string
&optional
fixedcase
literal
subexp
start
)
"Replace all matches for REGEXP with REP in STRING.
Return a new string containing the replacements.
...
...
@@ -1211,7 +1211,11 @@ function. If it is a function it is applied to each match to generate
the replacement passed to `replace-match'; the match-data at this
point are such that match 0 is the function's argument.
To replace a single match, make REGEXP match up to \\'."
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\"
"
;; To avoid excessive consing from multiple matches in long strings,
;; don't just call `replace-match' continually. Walk down the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment