]> granicus.if.org Git - flex/commitdiff
Documented set difference operator {-}.
authorJohn Millaway <john43@users.sourceforge.net>
Wed, 22 Mar 2006 20:03:43 +0000 (20:03 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Wed, 22 Mar 2006 20:03:43 +0000 (20:03 +0000)
doc/flex.texi

index c43d3ee8984c88387cbe3ef972fc18b8a1862819..12967211833fdcf2b5655d29128a2cc6a8bbe3c7 100644 (file)
@@ -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