From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Herbert Euler Newsgroups: gmane.emacs.devel Subject: RE: regexp-quote missing escapes in grouping constructs - Bug? Date: Fri, 13 Jun 2008 14:20:22 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1213338041 1998 80.91.229.12 (13 Jun 2008 06:20:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Jun 2008 06:20:41 +0000 (UTC) To: St/n_P/rm/n , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 13 08:21:24 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 1K72f3-0006Yx-24 for ged-emacs-devel@m.gmane.org; Fri, 13 Jun 2008 08:21:21 +0200 Original-Received: from localhost ([127.0.0.1]:43949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K72eF-0002tv-8E for ged-emacs-devel@m.gmane.org; Fri, 13 Jun 2008 02:20:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K72eA-0002td-JU for emacs-devel@gnu.org; Fri, 13 Jun 2008 02:20:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K72e8-0002tD-HE for emacs-devel@gnu.org; Fri, 13 Jun 2008 02:20:25 -0400 Original-Received: from [199.232.76.173] (port=35973 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K72e8-0002t7-8o for emacs-devel@gnu.org; Fri, 13 Jun 2008 02:20:24 -0400 Original-Received: from bay0-omc2-s15.bay0.hotmail.com ([65.54.246.151]:28480) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K72e8-0005j4-0V for emacs-devel@gnu.org; Fri, 13 Jun 2008 02:20:24 -0400 Original-Received: from BAY143-W14 ([65.55.154.49]) by bay0-omc2-s15.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Jun 2008 23:20:22 -0700 X-Originating-IP: [216.145.54.158] Importance: Normal In-Reply-To: X-OriginalArrivalTime: 13 Jun 2008 06:20:22.0298 (UTC) FILETIME=[8F5C0FA0:01C8CD1D] X-detected-kernel: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ 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:99066 Archived-At: > (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? > Shouldn't passing that string to regexp-quote give back something more > like this: > > ---> "[0-9]\\{2,4\\}\\(-\\|/\\)[0-9]?+(-\\|/)[0-9]\\{2,4\\}" I think this is because `regexp-quote' sees the string being processed by the Lisp reader, i.e. "\{" ==> "{" in the internal representation, while "\\{" ==> "\{": ELISP> (regexp-quote "[0-9]\{2,4\}") "\\[0-9]{2,4}" ELISP> (regexp-quote "[0-9]\\{2,4\\}") "\\[0-9]\\\\{2,4\\\\}" ELISP> Regards, Guanpeng Xu _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE