[latex3-commits] [git/LaTeX3-latex3-latex3] master: Escape some characters in example regexes (0e41195)
Bruno Le Floch
bruno at le-floch.fr
Sun Sep 23 10:54:50 CEST 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/0e411951646a2522e8a52db4493d633e76669be3
>---------------------------------------------------------------
commit 0e411951646a2522e8a52db4493d633e76669be3
Author: Bruno Le Floch <bruno at le-floch.fr>
Date: Sun Sep 23 10:54:50 2018 +0200
Escape some characters in example regexes
The documentation advises to escape all ascii non-alphanumeric characters
to be on the safe side.
>---------------------------------------------------------------
0e411951646a2522e8a52db4493d633e76669be3
l3kernel/l3regex.dtx | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index d4eb2c4..aae214e 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -114,23 +114,23 @@
% |\_.*?\_| where |.| matches arbitrary characters and the
% lazy quantifier |*?| means to match as few characters as
% possible, thus avoiding matching underscores.
-% \item |[+-]?\d+| matches an explicit integer with at most one
+% \item |[\+\-]?\d+| matches an explicit integer with at most one
% sign.
-% \item \verb*"[+\-\ ]*\d+\ *" matches an explicit integer with any
+% \item \verb*"[\+\-\ ]*\d+\ *" matches an explicit integer with any
% number of $+$ and $-$ signs, with spaces allowed except within the
% mantissa, and surrounded by spaces.
-% \item \verb*"[+\-\ ]*(\d+|\d*\.\d+)\ *" matches an explicit integer or
+% \item \verb*"[\+\-\ ]*(\d+|\d*\.\d+)\ *" matches an explicit integer or
% decimal number; using \verb*"[.,]" instead of \verb*"\." would allow
% the comma as a decimal marker.
% \item
-% \verb*"[+\-\ ]*(\d+|\d*\.\d+)\ *((?i)pt|in|[cem]m|ex|[bs]p|[dn]d|[pcn]c)\ *"
+% \verb*"[\+\-\ ]*(\d+|\d*\.\d+)\ *((?i)pt|in|[cem]m|ex|[bs]p|[dn]d|[pcn]c)\ *"
% \allowbreak matches an explicit dimension with any unit that \TeX{} knows, where
% \verb*"(?i)" means to treat lowercase and uppercase letters
% identically.
-% \item \verb*"[+\-\ ]*((?i)nan|inf|(\d+|\d*\.\d+)(\ *e[+-\ ]*\d+)?)\ *"
+% \item \verb*"[\+\-\ ]*((?i)nan|inf|(\d+|\d*\.\d+)(\ *e[\+\-\ ]*\d+)?)\ *"
% matches an explicit floating point number or the special values
% \verb*"nan" and \verb*"inf" (with signs and spaces allowed).
-% \item \verb*"[+\-\ ]*(\d+|\cC.)\ *" matches an explicit integer or
+% \item \verb*"[\+\-\ ]*(\d+|\cC.)\ *" matches an explicit integer or
% control sequence (without checking whether it is an integer
% variable).
% \item |\G.*?\K| at the beginning of a regular expression matches and
@@ -141,7 +141,7 @@
% \cs{regex_extract_all:nnN}.
% \end{itemize}
% While it is impossible for a regular expression to match only integer
-% expressions, \verb*"[+\-\(]*\d+\)*([+\-*/][+\-\(]*\d+\)*)*" matches among
+% expressions, \verb*"[\+\-\(]*\d+\)*([\+\-*/][\+\-\(]*\d+\)*)*" matches among
% other things all valid integer expressions (made only with explicit
% integers). One should follow it with further testing.
%
More information about the latex3-commits
mailing list