LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Sun, 16 Oct 2011 22:02:24 +0100
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID: <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=ISO-8859-1
From: Joseph Wright <[log in to unmask]>
Parts/Attachments: text/plain (26 lines)
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 \<var>_set:Nn functions are used with a variable of
name \l_..._<var>, while here we are (currently) naming as \l_..._tl.
-- 
Joseph Wright

ATOM RSS1 RSS2