summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex
diff options
context:
space:
mode:
authorkeramida <keramida@FreeBSD.org>2008-09-05 17:41:20 +0000
committerkeramida <keramida@FreeBSD.org>2008-09-05 17:41:20 +0000
commit8ba042b0de4fa3d3a53188959c9a4f551cf2bec7 (patch)
tree346186e191396ce2de5eec81ec821940f1516581 /lib/libc/regex
parentaa0fb0c85b0204f844e87c64cad6b03a4cdc4a0c (diff)
downloadFreeBSD-src-8ba042b0de4fa3d3a53188959c9a4f551cf2bec7.zip
FreeBSD-src-8ba042b0de4fa3d3a53188959c9a4f551cf2bec7.tar.gz
Add two example regexps: (1) one for matching all the characters
that belong in a character class, and (2) one for matching all the characters *not* in a character class. Submitted by: Mark B, mkbucc at gmail.com MFC after: 3 days
Diffstat (limited to 'lib/libc/regex')
-rw-r--r--lib/libc/regex/re_format.78
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libc/regex/re_format.7 b/lib/libc/regex/re_format.7
index d4555a0..463c6a2 100644
--- a/lib/libc/regex/re_format.7
+++ b/lib/libc/regex/re_format.7
@@ -288,6 +288,14 @@ These stand for the character classes defined in
A locale may provide others.
A character class may not be used as an endpoint of a range.
.Pp
+A bracketed expression like
+.Ql [[:class:]]
+can be used to match a single character that belongs to a character
+class.
+The reverse, matching any character that does not belong to a specific
+class, the negation operator of bracket expressions may be used:
+.Ql [^[:class:]] .
+.Pp
There are two special cases\(dd of bracket expressions:
the bracket expressions
.Ql [[:<:]]
OpenPOWER on IntegriCloud