summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2006-03-22 16:04:19 +0000
committerJohn Millaway <john43@users.sourceforge.net>2006-03-22 16:04:19 +0000
commitba6cb02a7bd77eced9d15a59bdf0e1ff1d8dee50 (patch)
tree7ea1a7ae8854be5e43c461387b1bb4ba79eba17b /doc
parenta6b8c36a85314758aae83a910b4e3cfea8560376 (diff)
Added negated character class expressions.
Documented negated character class expressions. Added regression test for negated character class expressions.
Diffstat (limited to 'doc')
-rw-r--r--doc/flex.texi22
1 files changed, 21 insertions, 1 deletions
diff --git a/doc/flex.texi b/doc/flex.texi
index 130cf09..c43d3ee 100644
--- a/doc/flex.texi
+++ b/doc/flex.texi
@@ -886,7 +886,10 @@ For example, the following character classes are all equivalent:
@end verbatim
@end example
-Some notes on patterns are in order.
+A word of caution. Character classes are expanded immediately when seen in the @code{flex} input.
+This means the character classes are sensitive to the locale in which @code{flex}
+is executed, and the resulting scanner will not be sensitive to the runtime locale.
+This may or may not be desirable.
@itemize
@@ -927,6 +930,23 @@ unfortunately the inconsistency is historically entrenched. Matching
newlines means that a pattern like @samp{[^"]*} can match the entire
input unless there's another quote in the input.
+Flex allows negation of character class expressions by prepending @samp{^} to
+the POSIX character class name.
+
+@example
+@verbatim
+ [:^alnum:] [:^alpha:] [:^blank:]
+ [:^cntrl:] [:^digit:] [:^graph:]
+ [:^lower:] [:^print:] [:^punct:]
+ [:^space:] [:^upper:] [:^xdigit:]
+@end verbatim
+@end example
+
+Flex will issue a warning if the expressions @samp{[:^upper:]} and
+@samp{[:^lower:]} appear in a case-insensitive scanner, since their meaning is
+unclear. The current behavior is to skip them entirely, but this may change
+without notice in future revisions of flex.
+
@cindex trailing context, limits of
@cindex ^ as non-special character in patterns
@cindex $ as normal character in patterns