33.15. The Wildcard Module
Prev | Chapter 33. Extensions Implemented as Modules | Next

## 33.15. The Wildcard Module

Wildcards, also called “Pathname Matching Notation”, describe sets of file names.

When this module is present, `*FEATURES*` contains the symbol `:WILDCARD`.

The “WILDCARD” package exports the following two symbols:

`(WILDCARD:MATCH `pattern` `string` `&KEY` `:START` `:END` :case-insensitive)`. This function returns a non-`NIL` value if the `string` matches the `pattern`.

`(WILDCARD:WILDCARD-MATCHER `pattern`)`. This function is a valid value for `CUSTOM:*APROPOS-MATCHER*`.

### 33.15.1. Wildcard Syntax

*
  Matches any zero or more characters.
?
  Matches any one character.
[`string`]
  Matches exactly one character that is a member of the `STRING` `string`. This is called a “character class”. As a shorthand, `string` may contain ranges, which consist of two characters with a dash between them. For example, the class `[a-z0-9_]` matches a lowercase letter, a number, or an underscore. You can negate a class by placing a #\! or #\^ immediately after the opening bracket. Thus, `[^A-Z@]` matches any character except an uppercase letter or an at sign.
\
  Removes the special meaning of the character that follows it. This works even in character classes.

### Note

Slash characters have no special significance in the wildcard matching, unlike in the shell (/bin/sh), in which wildcards do not match them. Therefore, a pattern `foo*bar` can match a file name `foo3/bar`, and a pattern `./sr*sc` can match a file name `./src/misc`.

| These notes document CLISP version 2.45 | Last modified: 2008-05-14

Enter your search termsSubmit search form
Webclisp.cons.orgclisp.podval.orgwww.lisp.org

Prev | Up | Next
33.14. Perl Compatible Regular Expressions | Home | 33.16. ZLIB Interface