From: "Juanma Barranquero" <lekktu@gmail.com>
To: HippoMan <hippoman@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Converting a non-escaped regexp to an escaped version
Date: Thu, 7 Jun 2007 16:21:07 +0200 [thread overview]
Message-ID: <f7ccd24b0706070721u7b3f2c11o9e3da1743ca2251@mail.gmail.com> (raw)
In-Reply-To: <1181219573.415318.285860@n4g2000hsb.googlegroups.com>
On 6/7/07, HippoMan <hippoman@gmail.com> wrote:
> 1. Test a regular expression interactively, for example, via
> the use of M-x re-search-forward.
>
> 2. Assume that I finally decide that the following regexp is
> the one that I want to use within my elisp code:
>
> \bfoo\b.*:.*\bbar\([0-9]\{9\}quack\.quack\)\b
>
> 3. Put this regexp to the kill ring.
>
> 4. Use my proposed function to yank it into my elisp code
> (for example, within an invocation of `match-string'), as follows:
>
> \\bfoo\\b.*:.*\\bbar\\([0-9]\\{9\\}quack\\.quack\\)\\b
You could use M-x re-builder to test your regexp, which is very nice,
supports several regexp syntaxes and can highlight subexpressions
(groups).
Then, inside the re-builder buffer, do C-c C-w (that's `reb-copy') to
copy the regexp.
Juanma
next prev parent reply other threads:[~2007-06-07 14:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-07 12:32 Converting a non-escaped regexp to an escaped version HippoMan
2007-06-07 14:14 ` Nikolaj Schumacher
2007-06-07 14:21 ` Juanma Barranquero [this message]
[not found] ` <mailman.1734.1181225695.32220.help-gnu-emacs@gnu.org>
2007-06-07 14:35 ` Joost Kremers
2007-06-07 15:12 ` HippoMan
2007-06-07 15:19 ` Joost Kremers
2007-06-11 9:31 ` Johan Bockgård
-- strict thread matches above, loose matches on Subject: below --
2007-06-07 21:25 martin rudalics
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=f7ccd24b0706070721u7b3f2c11o9e3da1743ca2251@mail.gmail.com \
--to=lekktu@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=hippoman@gmail.com \
/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.