From 0efdfdee5f888ed1f75e18910912294b45b55ccd Mon Sep 17 00:00:00 2001 From: Giorgos Keramidas Date: Fri, 5 Sep 2008 17:41:20 +0000 Subject: [PATCH] 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 --- lib/libc/regex/re_format.7 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/libc/regex/re_format.7 b/lib/libc/regex/re_format.7 index d4555a02d0a..463c6a27969 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 [[:<:]]