summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Langley <mightyjo@gmail.com>2022-05-11 17:41:53 -0400
committerJoseph Langley <mightyjo@gmail.com>2022-05-11 17:41:53 -0400
commit2bacaef4cf8ab274edfa87fbb11dfb5bba5d17f0 (patch)
tree1a415c798aba6642f4bf3d6ada1830818a90053a
parent3fe96958fa3d730f6adcac5979a57f03b705a196 (diff)
downloadflex-git-2bacaef4cf8ab274edfa87fbb11dfb5bba5d17f0.tar.gz
doc(manual): Correct character class examples and special meaning discussion.
See Issue 521 and 478.
-rwxr-xr-xdoc/flex.texi8
1 files 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