Article View: news.software.nntp
Article #44461[NNTP Draft] 5. The WILDMAT format
From: Andrew Gierth
Date: Sat, 26 Feb 2000 00:00
Date: Sat, 26 Feb 2000 00:00
64 lines
4253 bytes
4253 bytes
[This is one of a series of extracts from draft-ietf-nntpext-base-09.txt
which is available in full from the usual Internet-Draft archives.]
5. The WILDMAT format
Barber [Page 5]
INTERNET DRAFT November 1999
The WILDMAT format[5] described here is based on the version
first developed by Rich Salz which was derived from the format
used in the UNIX "find" command to articulate file names. It
was developed to provide a uniform mechanism for matching
patterns in the same manner that the UNIX shell matches
filenames. Patterns are implicitly anchored at the beginning
and end of each string when testing for a match. There are
five pattern-matching operations other than a strict one-to-
one match between the pattern and the source to be checked for
a match. The first is an asterisk (*) to match any sequence of
zero or more UTF-8 characters. The second is a question mark
(?) to match any single UTF-8 character. The third specifies a
specific set of characters. The set is specified as a list of
characters, or as a range of characters where the beginning
and end of the range are separated by a minus (or dash)
character, or as any combination of lists and ranges. The dash
can also be included in the set as a character it if is the
beginning or end of the set. This set is enclosed in square
brackets. The close square bracket (]) may be used in a set if
it is the first character in the set. The fourth operation is
the same as the logical not of the third operation and is
specified the same way as the third with the addition of a
caret character (^) at the beginning of the test string just
inside the open square bracket. The final operation uses the
backslash character to invalidate the special meaning of the
open square bracket ([), the asterisk, backslash, or the
question mark. The meaning of the backslash operator cannot be
negated by the exclamation point. Two backslashes in sequence
will result in the evaluation of the backslash as a character
with no special meaning.
5.1 Negating the expression
The exclamation point can be used at the beginning of a
wildmat to negate it. If it appears as any other character
other than the first one, it has no special meaning.
5.2 Examples
a) [^]-] -- matches any single character other than a
close square bracket or a minus sign/dash.
b) *bdc -- matches any string that ends with the string
"bdc" including the string "bdc" (without quotes).
c) [0-9a-zA-Z] -- matches any single printable
alphanumeric ASCII character.
d) a??d -- matches any four character string which
begins with a and ends with d.
e)!bc*d -- matches any string that does not start with
"bc" and end with "d" (without quotes)
--
Andrew.
Technical Details
Message-ID:
<87snyfd367.fsf@erlenstar.demon.co.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <87snyfd367.fsf@erlenstar.demon.co.uk> Subject: [NNTP Draft] 5. The WILDMAT format Date: Sat, 26 Feb 2000 00:00:00 +0000 From: Andrew Gierth <andrew@erlenstar.demon.co.uk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 590399654 X-Mayan-Date: Long count = 12.19.6.17.16; tzolkin = 13 Cib; haab = 4 Kayab X-Complaints-To: andrew@erlenstar.demon.co.uk Organization: disorganised X-Attribution: AG X-Pgp-0x0E9FFBE9: 87 25 7F 14 41 24 B3 51 E0 19 8B DE 49 74 0C 29 X-P-Persistent-Headers: are a bad idea. Newsgroups: news.software.nntp X-Post-Filter: postfilter v0.6 alpha