all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Wright <wrightmikea@gmail.com>
To: 15107@debbugs.gnu.org
Subject: bug#15107: reproduced on emacs-25 branch
Date: Sat, 5 Mar 2016 20:18:50 -0800	[thread overview]
Message-ID: <CAGkLq6ejGGE3r9HsNYehfd63=6WPJf3HWYcEOG7pbmp7D9JOAQ@mail.gmail.com> (raw)
In-Reply-To: <87eh9uk3c6.fsf@blah.blah>

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

Kevin Ryde <user42@zip.com.au> writes:

> replace-regexp-in-string behaves incorrectly if a regexp has \` among
> its matches.
>
>     (replace-regexp-in-string "\\`\\|X" "Z" "--XX--" t t)
>     =>
>     "Z--ZXZX--"
>
> where I expected
>
>     "Z--ZZ--"
>
> This seems to be due to the optimization in replace-regexp-in-string
> which re-matches on the matched substring.  \' can match the substring
> where it did not match in the middle of the full string.  In the example
> above "X" is the match in the full string, but on taking that "X" as a
> substring it can match "\\`".

I built the emacs-25 git branch I recreated the above bug today.

GNU Emacs 25.0.92.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version
10.9.5 (Build 13F1507))
 of 2016-03-05

[-- Attachment #2: Type: text/html, Size: 1234 bytes --]

  reply	other threads:[~2016-03-06  4:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15 22:15 bug#15107: 24.3; replace-regexp-in-string wrong on \` Kevin Ryde
2016-03-06  4:18 ` Michael Wright [this message]
2016-08-30 23:57 ` bug#15107: [PATCH] Add replace-regexp-in-string regression test Erik Anderson
2016-08-31 14:24   ` Eli Zaretskii
2016-08-31 14:36     ` Erik Anderson
2016-08-31 15:01       ` Eli Zaretskii
2016-08-31 15:13         ` Noam Postavsky
2016-08-31 15:32           ` Erik Anderson
2016-08-31 16:04           ` Eli Zaretskii
2016-09-01 15:46   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGkLq6ejGGE3r9HsNYehfd63=6WPJf3HWYcEOG7pbmp7D9JOAQ@mail.gmail.com' \
    --to=wrightmikea@gmail.com \
    --cc=15107@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.