From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: regexp-quote missing escapes in grouping constructs - Bug? Date: Fri, 13 Jun 2008 15:17:34 +0900 Message-ID: References: Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1213337915 1653 80.91.229.12 (13 Jun 2008 06:18:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Jun 2008 06:18:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: "St\/n_P\/rm\/n" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 13 08:19:18 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K72d4-0005sP-0F for ged-emacs-devel@m.gmane.org; Fri, 13 Jun 2008 08:19:18 +0200 Original-Received: from localhost ([127.0.0.1]:54371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K72cG-0002B4-1A for ged-emacs-devel@m.gmane.org; Fri, 13 Jun 2008 02:18:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K72bY-0001qw-A2 for emacs-devel@gnu.org; Fri, 13 Jun 2008 02:17:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K72bW-0001q7-9U for emacs-devel@gnu.org; Fri, 13 Jun 2008 02:17:43 -0400 Original-Received: from [199.232.76.173] (port=58122 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K72bW-0001q4-0V for emacs-devel@gnu.org; Fri, 13 Jun 2008 02:17:42 -0400 Original-Received: from tyo202.gate.nec.co.jp ([202.32.8.206]:62520) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K72bS-0005GI-B9; Fri, 13 Jun 2008 02:17:38 -0400 Original-Received: from relay31.aps.necel.com ([10.29.19.54]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m5D6HZ3c024902; Fri, 13 Jun 2008 15:17:35 +0900 (JST) Original-Received: from relay11.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay31.aps.necel.com with ESMTP; Fri, 13 Jun 2008 15:17:35 +0900 Original-Received: from dhapc248.dev.necel.com ([10.114.112.215] [10.114.112.215]) by relay11.aps.necel.com with ESMTP; Fri, 13 Jun 2008 15:17:35 +0900 Original-Received: by dhapc248.dev.necel.com (Postfix, from userid 31295) id 208D64E7; Fri, 13 Jun 2008 15:17:35 +0900 (JST) System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: (St's message of "Thu, 12 Jun 2008 19:39:12 -0400") Original-Lines: 22 X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:99065 Archived-At: "St/n_P/rm/n" writes: > (regexp-quote "[0-9]\{2,4\}\(-\|/\)[0-9]?+\(-\|/\)[0-9]\{2,4\}") > > ---> "\\[0-9]{2,4}(-|/)\\[0-9]\\?\\+(-|/)\\[0-9]{2,4}" > > Am I misunderstanding something? The backslashes you entered in the original lisp string were eaten by the lisp reader, so there are no backslashes in the string. Since (, ), |, etc., are not emacs regexp metacharacters (without a preceding backslash), there's no need to quote them. Here's what you probably meant: (regexp-quote "[0-9]\\{2,4\\}\\(-\\|/\\)[0-9]?+\\(-\\|/\\)[0-9]\\{2,4\\}") => "\\[0-9]\\\\{2,4\\\\}\\\\(-\\\\|/\\\\)\\[0-9]\\?\\+\\\\(-\\\\|/\\\\)\\[0-9]\\\\{2,4\\\\}" -Miles -- Joy, n. An emotion variously excited, but in its highest degree arising from the contemplation of grief in another.