all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jim Ottaway <j.ottaway@lse.ac.uk>
Subject: Re: Help with query-replace-regular expression
Date: Mon, 11 Sep 2006 16:57:01 +0100	[thread overview]
Message-ID: <87zmd6gzw2.fsf@lse.ac.uk> (raw)
In-Reply-To: 87wt8a4do4.fsf@offby1.atm01.sea.blarg.net

Eric Hanchrow <offby1@blarg.net> writes:

> Or escape "escape hell" and let "rx" write the regexp for you:
>
> (rx "/*#" (group (or (any alpha) "_")
>                  (or (any alnum) "_")) "#*/")
> That evaluates to
>
> "\\(?:/\\*#\\(\\(?:\\(?:[[:alpha:]]\\)\\|_\\)\\(?:\\(?:[[:alnum:]]\\)\\|_\\)\\)#\\*/\\)"

I don’t think you need both alpha and alnum, do you?.  Anyhow, nice
though rx is, you don’t get something that can be used for interactive
use of query-replace-regexp, since the escaping is for a string, rather
than for text entered in the minibuffer, where you don’t have to
double-escape the backslashes.

Regards,

-- 
Jim Ottaway

      reply	other threads:[~2006-09-11 15:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-11 13:22 Help with query-replace-regular expression jade_lindquist
2006-09-11 13:45 ` David Kastrup
2006-09-11 14:01 ` Jim Ottaway
2006-09-11 15:37   ` Eric Hanchrow
2006-09-11 15:57     ` Jim Ottaway [this message]

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=87zmd6gzw2.fsf@lse.ac.uk \
    --to=j.ottaway@lse.ac.uk \
    /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.