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