From: Anselm Helbig <anselm.helbig+news2009@googlemail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: help with Regexps
Date: Mon, 11 May 2009 10:33:32 +0200 [thread overview]
Message-ID: <87ocu0hwdf.wl%anselm.helbig+news2009@googlemail.com> (raw)
In-Reply-To: <mailman.6983.1242027435.31690.help-gnu-emacs@gnu.org>
Hi!
> I have a file that has these three types of entries (they all appear in
> the beginning of the line).
>
> 1. %\card{\word{Mutter}}{mom, mommy, mother, nut}
> 2. \card{\atl{die} \word{Erkenntnis}}{cognition, cognizance, perception}
> 3. \card{\word{Jünglinge}}{teens, younglings}
>
> And I want to be able to use (search-forward-regexp ???) within a
> function to find only 3. (and not 1. and 2).
>
> When I try: (search-forward-regexp "^\\card{\\word{[A-Z]"), emacs
> complains: Search failed: "^\\card{\\word{[A-Z]" (in fact, even
> (search-forward-regexp "^\\card") fails to find anything). What am I
> making wrong?
You have to quote the backslashes twice, the first time for the lisp
string and then for the regex:
(search-forward-regexp "^\\\\card{\\\\word{[A-Z]")
Ugly, but consistent.
HTH,
Anselm
--
Anselm Helbig
mailto:anselm.helbig+news2009@googlemail.com
next parent reply other threads:[~2009-05-11 8:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.6983.1242027435.31690.help-gnu-emacs@gnu.org>
2009-05-11 8:33 ` Anselm Helbig [this message]
2009-05-11 17:59 ` help with Regexps Santiago Mejia
2009-05-11 3:12 Santiago Mejia
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=87ocu0hwdf.wl%anselm.helbig+news2009@googlemail.com \
--to=anselm.helbig+news2009@googlemail.com \
--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.