emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

regexp repacement, how to present replacement to user?


From: Paul Pogonyshev
Subject: regexp repacement, how to present replacement to user?
Date: Sat, 13 Oct 2007 17:00:41 +0300
User-agent: KMail/1.7.2

Hi,

I basically have a loop of `re-search-forward' with optional `replace-match'
after that.  I'd like to ask user if the particular match should be replaced
or not.  However, I'd like to present user with end-result strings, i.e. not
regexp and replacement with \N strings, but the match string and what
replacement would be in this case.  The former is as easy as (match-string 0),
but the second is not obvious how to do.

I.e., to clarify, I'd like this:

        Replace "foo-bar" with "foo bar"?

instead of this:

        Replace "\([[:alpha:]]+\)-\([[:alpha:]]+\)" with "\1 \2"?

Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]