From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Explicitly numbered subgroups in regular expressions Date: Sun, 10 Jun 2007 09:19:00 -0400 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1181481709 31004 80.91.229.12 (10 Jun 2007 13:21:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Jun 2007 13:21:49 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 10 15:21:47 2007 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 1HxNMZ-00081Y-93 for ged-emacs-devel@m.gmane.org; Sun, 10 Jun 2007 15:21:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HxNMY-0004FH-QN for ged-emacs-devel@m.gmane.org; Sun, 10 Jun 2007 09:21:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HxNJt-0002Ps-PB for emacs-devel@gnu.org; Sun, 10 Jun 2007 09:19:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HxNJs-0002Oo-Tw for emacs-devel@gnu.org; Sun, 10 Jun 2007 09:19:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HxNJs-0002OY-G7 for emacs-devel@gnu.org; Sun, 10 Jun 2007 09:19:00 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HxNJs-00063m-G4 for emacs-devel@gnu.org; Sun, 10 Jun 2007 09:19:00 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1HxNJs-0005hQ-0i; Sun, 10 Jun 2007 09:19:00 -0400 In-reply-to: (message from Stefan Monnier on Sat, 09 Jun 2007 16:37:44 -0400) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:72569 Archived-At: What it does is add a new regexp syntax \(?:\) which is like \(\) except that it specifies explicitly the number of the subgroup. E.g. (and (string-match "\\(?3:a\\)" "a") (match-data)) returns (0 1 nil nil nil nil 0 1). There is no backward compatibility issue with this patch: such regexps are currently rejected as invalid. The feature seems useful, but how does this affect the numbering of groups that don't specify a number? That has to be done right, then documented in the two manuals.