all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: re-builder vs replace-regexp
Date: Fri, 25 Nov 2011 09:25:15 +0100	[thread overview]
Message-ID: <4ECF50EB.9030900@easy-emacs.de> (raw)
In-Reply-To: <CAC4Co6OZ0zMpDoXGzdz1X0S+Rro_XPEn+agofqOBLc1SCQX9EA@mail.gmail.com>

Am 24.11.2011 20:24, schrieb Андрей Парамонов:
> Re-Builder is a great tool. It allows interactive search with
> incredibly handy highlight, subexpression mode, etc. However, one
> often needs not just search by regexp, but also perform regexp
> replace. I thought reb-copy command would help me to pass my regexp to
> replace-regexp. But replace-regexp doesn't understand the result of
> reb-copy, i.e. for default *scratch* buffer the following regexp works
> in Re-Builder:
>
> "\\(file\\)"
>
> but to make it suitable for search-forward-regexp/replace-regexp I
> need to manually adjust it to
>
> \(file\)
>
> I find it really inconvenient (the larger regexp the more
> inconvenient). Should I report a bug, or I'm missing something basic?
> I'm running GNU Emacs 23.3.1.
>
> Best wishes,
> Andrey Paramonov
>
>

Hi Andrey,

think these are valid considerations on the road.
A lot of questions are around.

For example using Regexps are one way. Exist other procedures.
Also writing a function to perform replacements is faster in some cases 
then doing it with just one regexp.

In all cases being tempted to use such a tool, rather split the issue.

Writing a function which changes

 > "\\(file\\)"
 >
 > \(file\)

should be a way to proceed.

HTH,

Andreas








  reply	other threads:[~2011-11-25  8:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-24 19:24 re-builder vs replace-regexp Андрей Парамонов
2011-11-25  8:25 ` Andreas Röhler [this message]
2011-11-25  9:22 ` Eric Abrahamsen

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=4ECF50EB.9030900@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@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.