[latex3-commits] [git/LaTeX3-latex3-latex3] gh590: l3regex: document that \ur and \u escapes allow quantifiers [ci skip] (63f089f9f)

Bruno Le Floch blflatex at gmail.com
Mon Apr 26 18:23:13 CEST 2021


Repository : https://github.com/latex3/latex3
On branch  : gh590
Link       : https://github.com/latex3/latex3/commit/63f089f9f02c508dce2ca3cab088ec505286c55b

>---------------------------------------------------------------

commit 63f089f9f02c508dce2ca3cab088ec505286c55b
Author: Bruno Le Floch <blflatex at gmail.com>
Date:   Mon Apr 26 18:23:13 2021 +0200

    l3regex: document that \ur and \u escapes allow quantifiers [ci skip]


>---------------------------------------------------------------

63f089f9f02c508dce2ca3cab088ec505286c55b
 l3kernel/l3regex.dtx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index 6e6b8f2db..6c49e90b2 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -333,9 +333,7 @@
 % which are obtained by applying \cs{exp_not:v} \Arg{var~name} at the
 % time the regular expression is compiled. Within a |\c{...}|
 % control sequence matching, the |\u| escape sequence only expands its
-% argument once, in effect performing \cs{tl_to_str:v}. Quantifiers are
-% not supported directly: use a group, for instance as in
-% |(?:\u|\Arg{var~name}|){2,4}|.
+% argument once, in effect performing \cs{tl_to_str:v}.
 %
 % The |\ur| escape sequence allows to insert the contents of a |regex|
 % variable into a larger regular expression.  For instance,
@@ -347,6 +345,12 @@
 % is equivalent to \verb"A(?:B|C)D" (matching |ABD| or |ACD|) and not to
 % \verb"AB|CD" (matching |AB| or |CD|).
 %
+% Quantifiers are supported for the |\u| and |\ur| constructions: for
+% instance, after \cs[no-index]{regex_set:Nn}
+% \cs[no-index]{l_item_regex} |{| |[a-z]+| |,?| |}|, the regex
+% |\ur{l_item_regex}+| matches one or more \enquote{words} separated by
+% optional commas.
+%
 % The option |(?i)| makes the match case insensitive (identifying
 % \texttt{A}--\texttt{Z} with \texttt{a}--\texttt{z}; no Unicode support
 % yet). This applies until the end of the group in which it appears, and





More information about the latex3-commits mailing list.