[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug Report -- replace-regexp-in-string from subr.el
From: |
Davis Herring |
Subject: |
Re: Bug Report -- replace-regexp-in-string from subr.el |
Date: |
Mon, 21 Apr 2014 08:06:26 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110717 Lanikai/3.1.11 |
> 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 "actual text of each match" is (match-string 0), not (match-string
> subexp).
If it's not obvious, you can write (match-string 1 s) in your
replacement function to get the desired behavior.
Davis
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.