unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: <tomas@tuxteam.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: how to use a variable inside Emacs regex features ?
Date: Thu, 23 May 2019 18:37:04 +0200	[thread overview]
Message-ID: <87woih161b.fsf@web.de> (raw)
In-Reply-To: <20190523065308.GA28035@tuxteam.de> (tomas@tuxteam.de's message of "Thu, 23 May 2019 08:53:08 +0200")

<tomas@tuxteam.de> writes:

> If you are doing more complex things, you might like 'rx', which
> allows you to write regular expressions in S-expression syntax,
> thus giving you access to template macros and all that goodness.

This is a task for rx indeed - or rx-to-string when the regexp depends
on the run-time value of a variable:

(let ((ntimes 8))
  (re-search-forward
   (rx-to-string `(= ,ntimes "hello"))))


Michael.



      reply	other threads:[~2019-05-23 16:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23  3:15 how to use a variable inside Emacs regex features ? Budi
2019-05-23  3:52 ` Drew Adams
2019-05-23  4:46   ` Budi
2019-05-23  6:53     ` tomas
2019-05-23 16:37       ` Michael Heerdegen [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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87woih161b.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tomas@tuxteam.de \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).