Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id p9GL54Kv013375 for ; Sun, 16 Oct 2011 23:05:05 +0200 Received: (qmail 3795 invoked by alias); 16 Oct 2011 21:04:59 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 16 Oct 2011 21:04:59 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx089) with SMTP; 16 Oct 2011 23:04:59 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p9GL2awv025792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Oct 2011 23:02:36 +0200 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p9GCVEEb010512; Sun, 16 Oct 2011 23:02:35 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1785230 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 16 Oct 2011 23:02:35 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p9GL2ZOb000660 for ; Sun, 16 Oct 2011 23:02:35 +0200 Received: from anchor-post-3.mail.demon.net (anchor-post-3.mail.demon.net [195.173.77.134]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p9GL2OQl025768 for ; Sun, 16 Oct 2011 23:02:28 +0200 Received: from cremornelane.demon.co.uk ([80.177.25.195] helo=palladium.local) by anchor-post-3.mail.demon.net with esmtp (Exim 4.69) id 1RFXqi-0003uj-ol for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 16 Oct 2011 21:02:24 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 References: X-Enigmail-Version: 1.3.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4E9B4660.8020900@morningstar2.co.uk> Date: Sun, 16 Oct 2011 22:02:24 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: Strings, and regular expressions To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Sender is in whitelist: joseph.wright@MORNINGSTAR2.CO.UK); Detail=5D7Q89H36p4L00VTXC6D4q0N+AH0PUCnBi0P5cROEGjO+pG7NAH/K+tf9SrVFtpLrKONl 2T9EL4W4U4jgzLbnCcGpk1z/zwmKT/K1fv3lD0=V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 6949 On 10/10/2011 16:07, Bruno Le Floch wrote: > The l3regex module allows for testing if a string matches a given > regular expression, counting matches, extracting submatches, splitting > at occurrences of a regular expression, and doing replacement (see > documentation for function names). I'm not sure about the approach on submatches. You say % Submatches with numbers higher than $10$ are accessed in the same way, % namely |\10|, |\11|, \emph{etc}. To insert in the replacement text % a submatch followed by a digit, the digit must be entered using the % |\x| escape sequence: for instance, to get the first submatch followed % by the digit $7$, use |\1\x37|, because $7$ has character code |37| % (in hexadecimal). I wonder how likely it is that we'll need more than 9 submatches in the sort of scenario that l3regex is likely to applied in. TeX programmers are already used to the idea that we have up to 9 numbered parameters, so why not limit to nine submatches and avoid the need to use "\x" syntax? I wonder if \regex_set:Nn would be better as \regex_save:Nn. My reasoning is that \_set:Nn functions are used with a variable of name \l_..._, while here we are (currently) naming as \l_..._tl. -- Joseph Wright