From 2bacaef4cf8ab274edfa87fbb11dfb5bba5d17f0 Mon Sep 17 00:00:00 2001 From: Joseph Langley Date: Wed, 11 May 2022 17:41:53 -0400 Subject: doc(manual): Correct character class examples and special meaning discussion. See Issue 521 and 478. --- doc/flex.texi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/flex.texi b/doc/flex.texi index 0302e5d..a2e0dce 100755 --- a/doc/flex.texi +++ b/doc/flex.texi @@ -887,7 +887,11 @@ an end-of-file when in start condition @code{s1} or @code{s2} Note that inside of a character class, all regular expression operators lose their special meaning except escape (@samp{\}) and the character class -operators, @samp{-}, @samp{]]}, and, at the beginning of the class, @samp{^}. +operators, @samp{-}, @samp{]}, and, at the beginning of the class, @samp{^}. +Additionally, @samp{-} and @samp{]} lose their special meaning if they +immediately follow the @samp{[} or @samp{[^} that start the class. Finally, +@samp{-} loses its special meaning if it immediately precedes the @samp{]} +that ends the class. @cindex patterns, precedence of operators The regular expressions listed above are grouped according to @@ -966,7 +970,7 @@ For example, the following character classes are all equivalent: @verbatim [[:alnum:]] [[:alpha:][:digit:]] - [[:alpha:][0-9]] + [[:alpha:]0-9] [a-zA-Z0-9] @end verbatim @end example -- cgit v1.2.1