From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= Newsgroups: gmane.emacs.help Subject: Re: Numbered regexps throw invalid regex error Date: Wed, 25 Jan 2012 21:02:13 +0100 Message-ID: <4F205FC5.90106@easy-emacs.de> References: <4F203A13.20105@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1327521749 18079 80.91.229.12 (25 Jan 2012 20:02:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 25 Jan 2012 20:02:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 25 21:02:26 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rq933-0003IS-Mf for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Jan 2012 21:02:25 +0100 Original-Received: from localhost ([::1]:60923 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq933-0007gd-9E for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Jan 2012 15:02:25 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq92y-0007dQ-79 for help-gnu-emacs@gnu.org; Wed, 25 Jan 2012 15:02:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rq92x-0000cC-0c for help-gnu-emacs@gnu.org; Wed, 25 Jan 2012 15:02:20 -0500 Original-Received: from moutng.kundenserver.de ([212.227.17.8]:63098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq92w-0000c8-Oy for help-gnu-emacs@gnu.org; Wed, 25 Jan 2012 15:02:18 -0500 Original-Received: from [192.168.178.27] (brln-4db9e8a7.pool.mediaWays.net [77.185.232.167]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0MHG5L-1RmaHz3z9f-00E31M; Wed, 25 Jan 2012 21:02:17 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.24) Gecko/20111101 SUSE/3.1.16 Thunderbird/3.1.16 In-Reply-To: X-Provags-ID: V02:K0:vQfaFF2m1vcgCcT9RZGxy5EJf3VKq67c3ETkJqi2ppP a7QEIJyOTNGXkHwTTNskcLi1JwtoQUigyH9JIhwSx2X8p1eg1d FvMp2bvYovrCMVggAUFwd41gf7eWSDnrDp8mfu+maIO30nQv5V 75B9VYD1yS7bDQ+QpbimanXyk01j/fwSPvCPKHH97Ab8dOZIBo U4NwvmGtaXDz65fUik6hyCKBy8T3XRJS24G3h8nOHn07Bmsa4b rfMxlie86vQOIuvVIAbD/31bmZ1hLwP8qjOoX7jQD7LgMvv0+X pt3njugkP80xSoksJYtfpZgQUPMI4wXv6/vNw6owymVpOa5w15 DXzM9PoLyqAFBTawOnvOEwphCnYaEA297hGFpGIp2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.17.8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83563 Archived-At: Am 25.01.2012 18:51, schrieb Tom: > Andreas Röhler easy-emacs.de> writes: > >> >> Am 25.01.2012 11:17, schrieb Tom: >>> (looking-at "\\(a\\c(?1:b\\)\\)") >>> >> AFAIU there are serveral errors, >> >> think you can't refer to first match inside itself >> > > You misunderstand the feature. > > It's not a backreference. It's an explicit numbering of > the group, so it doesn't change if you add more parens: > > `\(?NUM: ... \)' > is the "explicitly numbered group" construct. Normal groups get > their number implicitly, based on their position, which can be > inconvenient. This construct allows you to force a particular > group number. There is no particular restriction on the numbering, > e.g. you can have several groups with the same number in which case > the last one to match (i.e. the rightmost match) will win. > Implicitly numbered groups always get the smallest integer larger > than the one of any previous group. > > > > Okay, next try :) you can't assign a group number already assigned automatically that would work: (looking-at "\\(?2:a\\(?1:b\\)c\\)")