From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: How can I assign a regex to a variable? Date: Thu, 28 Jul 2016 13:25:42 -0700 (PDT) Message-ID: <047b385d-5843-4548-810f-de411a62de20@default> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1469737606 23818 80.91.229.3 (28 Jul 2016 20:26:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jul 2016 20:26:46 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Yuri Khan , Tom Browder Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 28 22:26:34 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bSrsz-0004sK-Rg for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Jul 2016 22:26:29 +0200 Original-Received: from localhost ([::1]:55508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSrst-0004J4-J5 for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Jul 2016 16:26:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSrsR-0004If-Fu for help-gnu-emacs@gnu.org; Thu, 28 Jul 2016 16:25:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSrsL-0002nM-HB for help-gnu-emacs@gnu.org; Thu, 28 Jul 2016 16:25:54 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:50228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSrsL-0002nG-7I for help-gnu-emacs@gnu.org; Thu, 28 Jul 2016 16:25:49 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u6SKPl2P002203 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Jul 2016 20:25:47 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u6SKPkXN005047 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Jul 2016 20:25:47 GMT Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u6SKPhD8015017; Thu, 28 Jul 2016 20:25:45 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110981 Archived-At: > Show a small but complete example that demonstrates the problem. > Someone will be able to tell you what=E2=80=99s wrong with it. >=20 > 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-Expression= s.html