GNU bug report logs - #15107
24.3; replace-regexp-in-string wrong on \`

Previous Next

Package: emacs;

Reported by: Kevin Ryde <user42 <at> zip.com.au>

Date: Thu, 15 Aug 2013 22:17:02 UTC

Severity: normal

Tags: confirmed, patch

Merged with 44861

Found in versions 24.3, 25.1, 27.1

Done: Mattias EngdegÄrd <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


Message #27 received at 15107 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Erik Anderson <erikbpanderson <at> gmail.com>, 15107 <at> debbugs.gnu.org
Subject: Re: bug#15107: [PATCH] Add replace-regexp-in-string regression test
Date: Wed, 31 Aug 2016 11:13:05 -0400
On Wed, Aug 31, 2016 at 11:01 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> From: Erik Anderson <erikbpanderson <at> gmail.com>
>> Date: Wed, 31 Aug 2016 14:36:06 +0000
>> Cc: 15107 <at> debbugs.gnu.org
>>
>> Per the replace-regexp-in-string docstring: "Replace all matches for REGEXP with REP in STRING."
>
> Yes, and there is a single match in this case, so a single
> replacement.  The _entire_ input string matches the regexp, so after
> that match there's nothing else left to match.
>
> What am I missing?

"^." matches only the first character of "foo bar", but maybe you have
a different idea of "matches" than I do. I would consider "^..*" to
match the whole string.




This bug report was last modified 4 years and 170 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.