[latex3-commits] [git/latex3] master: Escape some minus signs in regex examples (2f4c7e1)

Bruno Le Floch bruno at le-floch.fr
Wed Dec 13 03:22:08 CET 2017


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/2f4c7e1a744fa992e54a369da654f2a43633ac99

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

commit 2f4c7e1a744fa992e54a369da654f2a43633ac99
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Tue Dec 12 21:22:08 2017 -0500

    Escape some minus signs in regex examples
    
    (Reported in tex.stackexchange.com/questions/405796 )


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

2f4c7e1a744fa992e54a369da654f2a43633ac99
 l3kernel/l3regex.dtx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index 41b3102..9d756e8 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -118,21 +118,21 @@
 %   possible, thus avoiding matching underscores.
 % \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 sourrounded by spaces.
-% \item \verb*"[+-\ ]*(\d+|\d*\.\d+)\ *" matches an explict integer or
+% \item \verb*"[+\-\ ]*(\d+|\d*\.\d+)\ *" matches an explict 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)\ *"
-%   matches an explicit dimension with any unit that \TeX{} knows, where
+%   \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).
-% \item \verb*"[+-\ ]*(\d+|\cC.)\ *" matches an explicit integer or
+%   \verb*"nan" and \verb*"inf" (with signs and spaces allowed).
+% \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
@@ -143,7 +143,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