[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multiple search strings in query-replace-regexp
From: |
Ilya Zakharevich |
Subject: |
Re: multiple search strings in query-replace-regexp |
Date: |
Mon, 9 Oct 2006 21:53:17 +0000 (UTC) |
User-agent: |
trn [how to get a version via %-escapes???] with a custom header |
[A complimentary Cc of this posting was sent to
Stefan Monnier
<monnier@iro.umontreal.ca>], who wrote in article
<jwvu02epwqf.fsf-monnier+gnu.emacs.help@gnu.org>:
> > How about rereading what I wrote above? "To make it useful, one needs
> > a function to count the number of parentheses in a given regular
> > expression. Is there?"
>
> `regexp-opt-depth' claims to do that. I believe the version in Emacs-CVS is
> pretty reliable.
Thanks; still, when combining several regexps into one, one needs to
fixup backreferences. Given the horrible ELisp regexp syntax, this
requires some dirty backwacking... E.g., I'm not sure I would be able
to do it right first time (hint: the newer CPerl facification of
RegExps would do it very easy with Perl regexps; much harder to do it
with ELisp...).
Hmm, I see that at least in Elist v19, backreferences went only up to
9; sigh... Well, this is not needed very often, one could just
(error
"RegExp limitation hit, try to make pattern(s) with backreferences first")
or some such.
-------
Additionally, when interpolating replacement string, one should also
shift match-group references by corresponding amount; but this is
easier done in the code of interpolator (I hope it is in ELisp, not in
C).
Yours,
Ilya
- Re: multiple search strings in query-replace-regexp, (continued)
- Re: multiple search strings in query-replace-regexp, David Kastrup, 2006/10/06
- Re: multiple search strings in query-replace-regexp, Ilya Zakharevich, 2006/10/07
- Message not available
- Re: multiple search strings in query-replace-regexp, David Kastrup, 2006/10/07
- Re: multiple search strings in query-replace-regexp, Ilya Zakharevich, 2006/10/07
- Re: multiple search strings in query-replace-regexp, David Kastrup, 2006/10/07
- Re: multiple search strings in query-replace-regexp, Ilya Zakharevich, 2006/10/07
- Re: multiple search strings in query-replace-regexp, Mathias Dahl, 2006/10/08
- Re: multiple search strings in query-replace-regexp, Kim F. Storm, 2006/10/08
- Message not available
- Re: multiple search strings in query-replace-regexp, Mathias Dahl, 2006/10/12
- Re: multiple search strings in query-replace-regexp, Stefan Monnier, 2006/10/09
- Re: multiple search strings in query-replace-regexp,
Ilya Zakharevich <=
- Re: multiple search strings in query-replace-regexp, David Kastrup, 2006/10/09
- Re: multiple search strings in query-replace-regexp, Ilya Zakharevich, 2006/10/09
- Re: multiple search strings in query-replace-regexp, Malte Spiess, 2006/10/07
- Re: multiple search strings in query-replace-regexp, David Kastrup, 2006/10/07
Re: multiple search strings in query-replace-regexp, Peter Dyballa, 2006/10/06
Message not available