all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Yuri Khan <yuri.v.khan@gmail.com>, Tom Browder <tom.browder@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: RE: How can I assign a regex to a variable?
Date: Thu, 28 Jul 2016 13:25:42 -0700 (PDT)	[thread overview]
Message-ID: <047b385d-5843-4548-810f-de411a62de20@default> (raw)
In-Reply-To: <CAP_d_8UOhWgTSta0WnZNR7Mt_KMPV+9W43zYXydRPKD_q6=1Zw@mail.gmail.com>

> Show a small but complete example that demonstrates the problem.
> Someone will be able to tell you what’s wrong with it.
> 
> In Emacs, regexps are not special. They are just strings. If you
> assign a regexp string to a variable, you should be able to use that
> variable in all the ways you could use an actual regexp string.

What Yuri said.  My guess is that the error message was
telling you that the characters in the string you provided
do not comprise a valid regexp.  A regexp is represented
in Emacs Lisp by a string of characters, but not every
string of characters is a regular expression.

Consult the Elisp manual, starting a node `Regular Expressions',
for the syntax of an Elisp regexp.

http://www.gnu.org/software/emacs/manual/html_node/elisp/Regular-Expressions.html



  reply	other threads:[~2016-07-28 20:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28 19:36 How can I assign a regex to a variable? Tom Browder
2016-07-28 19:48 ` Yuri Khan
2016-07-28 20:25   ` Drew Adams [this message]
2016-07-28 20:44     ` Tom Browder
2016-07-28 20:57       ` Drew Adams
2016-07-28 21:57         ` Tom Browder
     [not found]     ` <mailman.2250.1469738663.26859.help-gnu-emacs@gnu.org>
2016-07-29  7:08       ` Barry Margolin

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=047b385d-5843-4548-810f-de411a62de20@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tom.browder@gmail.com \
    --cc=yuri.v.khan@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.