Wildmat

Wildmat

wildmat is a pattern matching library developed by Rich Salz. Based on the wildcard syntax already used in the Bourne shell, wildmat provides a uniform mechanism for matching patterns across applications with simpler syntax than that typically offered by regular expressions. Patterns are implicitly anchored at the beginning and end of each string when testing for a match.

Pattern matching operations

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 characters.
* The second is a question mark (?) to match any single 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 if it 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. Two backslashes in sequence will result in the evaluation of the backslash as a character with no special meaning.

Usage

wildmat is most commonly seen in NNTP implementations such as Salz' own INN, also in unrelated software such as GNU tar.

The full wildmat syntax is unable to handle multibyte character sets, and poses problems when the text being searched may contain multiple incompatible character sets. A simplified version of wildmat oriented toward UTF-8 encoding has been developed by the IETF NNTP working group, to be included in an upcoming standards document.

External links

* [http://groups.google.co.uk/groups?selm=1991Apr4.034350.3923%40sparky.IMD.Sterling.COM comp.sources.misc article] from Rich Salz containing the wildmat source code


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Wildcard character — For other meanings of wild card see wild card. The term wildcard character has the following meanings: TelecommunicationIn telecommunications, a wildcard character is a character that may be substituted for any of a defined subset of all possible …   Wikipedia

  • Scorefile — Some Usenet newsreaders, especially in the Unix world, have tried to make it easier to find interesting postings and filter useless ones. To accomplish this, these newsreaders provide so called scorefiles, which are sets of rules that, when… …   Wikipedia

  • Glob (programming) — In computer programming, the verb glob or globbing is used to refer to an instance of pattern matching behavior. The noun glob is sometimes used to refer to a particular pattern, e.g. use the glob *.log to match all those log files .Many command… …   Wikipedia

  • Usenet Explorer — Infobox Software name = Usenet Explorer caption = author = developer = developer = Alex Birj released = 2005 latest release version = 2.2 latest release date = 2008 07 17 latest preview version = latest preview date = programming language =… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”