[latex3-commits] [git/LaTeX3-latex3-latex3] gh1010-doc: Clarify l3regex documentation for category code tests (fixes #996) (0a18aaf7c)

Bruno Le Floch blflatex at gmail.com
Mon Nov 1 21:39:28 CET 2021


Repository : https://github.com/latex3/latex3
On branch  : gh1010-doc
Link       : https://github.com/latex3/latex3/commit/0a18aaf7c203eba9885bfaee9721e33b0089b9c2

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

commit 0a18aaf7c203eba9885bfaee9721e33b0089b9c2
Author: Bruno Le Floch <blflatex at gmail.com>
Date:   Mon Nov 1 21:39:28 2021 +0100

    Clarify l3regex documentation for category code tests (fixes #996)


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

0a18aaf7c203eba9885bfaee9721e33b0089b9c2
 l3kernel/l3regex.dtx | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index 520127ae7..0e2c5c523 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -165,7 +165,7 @@
 %   |\A|, |\B|, \ldots{} have special meanings;
 % \item non-alphanumeric printable ascii characters can (and should)
 %   always be escaped: many of them have special meanings (\emph{e.g.},
-%   use |\(|, |\)|, |\?|, |\.|);
+%   use |\(|, |\)|, |\?|, |\.|, |\^|);
 % \item spaces should always be escaped (even in character
 %   classes);
 % \item any other character may be escaped or not, without any
@@ -336,11 +336,14 @@
 %     \meta{regex}, anchored at the beginning and end, so that |\c{begin}|
 %     matches exactly \cs[no-index]{begin}, and nothing else.
 %   \item[\\cX] Applies to the next object, which can be a character,
-%     character property, class, or group, and forces this object to
-%     only match tokens with category |X| (any of |CBEMTPUDSLOA|. For
-%     instance, |\cL[A-Z\d]| matches uppercase letters and digits of
-%     category code letter, |\cC.| matches any control sequence, and
-%     |\cO(abc)| matches |abc| where each character has category other.
+%     escape character sequence such as |\x{0A}|, character class, or
+%     group, and forces this object to only match tokens with category
+%     |X| (any of |CBEMTPUDSLOA|. For instance, |\cL[A-Z\d]| matches
+%     uppercase letters and digits of category code letter, |\cC.|
+%     matches any control sequence, and |\cO(abc)| matches |abc| where
+%     each character has category other.\footnote{This last example also
+%     captures \enquote{\texttt{abc}} as a regex group; to avoid this
+%     use a non-capturing group \texttt{\textbackslash cO(?:abc)}.}
 %   \item[{\\c[XYZ]}] Applies to the next object, and forces it to only
 %     match tokens with category |X|, |Y|, or |Z| (each being any of
 %     |CBEMTPUDSLOA|). For instance, |\c[LSO](..)| matches two tokens of





More information about the latex3-commits mailing list.