help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: re-builder vs replace-regexp


From: Andreas Röhler
Subject: Re: re-builder vs replace-regexp
Date: Fri, 25 Nov 2011 09:25:15 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.24) Gecko/20111101 SUSE/3.1.16 Thunderbird/3.1.16

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 via email to

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