Changi NNTP Server 1.0

[ Bottom of Page | Previous Page | Next Page | Table of Contents ]

Pattern Matching

Several parts of the Changi distribution use limited regular expressions for pattern matching.

\x
turns off the special interpretation of x. This may be used, for example, in front of a question mark if you mean question mark and not any single character. A backslash itself can be given by a double backslash.

?
matches any single character.

*
matches anything, even nothing.

[abcdef]
matches any character of a set of characters given inside the square brackets.

[a-f]
matches any character of a sequence of characters given inside the square brackets.

[^abcdefg]
matches any character not part of a set of characters given inside the square brackets.

Note, that the first character inside the square brackets may not be properly displayed on the browser you're using to read this manual. It should be an exponential sign (up arrow), of which the ASCII code is 94 decimal.

[]a-z]
matches any lowercase letter or closing bracket. Note this special case where the closing bracket is the first character of a set and therefore interpreted as a part of the set.

[a-z-]
matches any lowercase letter or minus sign. The minus sign is treated as a minus sign if it's the first or last character in a set.

Some samples may help you to follow the rules.
*os*
matches any string of any size containing at least one o followed immediatly by an s .

?os*
matches any string of any size with an o as a second and the s as the third character.

[1-9xyz]
is a shorthand for [123456789xyz].

[A-Za-z]
matches any letter, upper- and lowercase.

[a-z][A-Z]
matches any two-character string with a lowercase letter in front followed by an uppercase letter.

[^0-9]*
matches any string not starting with a digit.

*\*
matches any string with a trailing asterisk.

[]-]
matches a closing bracket or a minus sign.

Single items of comma separated newsgroups may also be preceeded by ! to exclude these groups.
*tcp-ip,!alt*
matches any group ending on tcp-ip and not beginning with alt .

[ Top of Page | Previous Page | Next Page | Table of Contents ]


URL: changi/manual/match.html
Created: 27 October 1996
Revised: 21 November 1996
Author: harald@os2point.ping.de