Skip to content

Commit

Permalink
Escape some minus signs in regex examples
Browse files Browse the repository at this point in the history
(Reported in tex.stackexchange.com/questions/405796 )
  • Loading branch information
Bruno Le Floch committed Dec 13, 2017
1 parent 74f01c6 commit 2f4c7e1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions l3kernel/l3regex.dtx
Expand Up @@ -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
Expand All @@ -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.
%
Expand Down

0 comments on commit 2f4c7e1

Please sign in to comment.