From: John Millaway <john43@users.sourceforge.net>
Date: Wed, 22 Mar 2006 20:03:43 +0000 (+0000)
Subject: Documented set difference operator {-}.
X-Git-Tag: flex-2-5-34~96
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e620bfb4703d82b4a1a38f6f2a0b5a083b54fe04;p=flex

Documented set difference operator {-}.
---

diff --git a/doc/flex.texi b/doc/flex.texi
index c43d3ee..1296721 100644
--- a/doc/flex.texi
+++ b/doc/flex.texi
@@ -693,6 +693,9 @@ character EXCEPT an uppercase letter.
 any character EXCEPT an uppercase letter or
 a newline
 
+@item [a-z]{-}[aeiou]
+the lowercase consonants
+
 @item r*
 zero or more r's, where r is any regular expression
 
@@ -947,6 +950,16 @@ Flex will issue a warning if the expressions @samp{[:^upper:]} and
 unclear. The current behavior is to skip them entirely, but this may change
 without notice in future revisions of flex.
 
+@item
+
+The @samp{@{-@}} operator computes the difference of two character classes. For
+example, @samp{[a-c]@{-@}[b-z]} represents all the characters in the class
+@samp{[a-c]} that are not in the class @samp{[b-z]} (which in this case, is
+just the single character @samp{a}). The @samp{@{-@}} operator is left
+associative, so @samp{[abc]@{-@}[b]@{-@}[c]} is the same as @samp{[a]}. Be careful
+not to accidently create an empty set, which will never match.
+
+
 @cindex trailing context, limits of
 @cindex ^ as non-special character in patterns
 @cindex $ as normal character in patterns