patterns
                no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | patterns [2006/08/29 16:08] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | =====Pattern Matching===== | ||
| + | |||
| + | Literally, any string is a pattern.  | ||
| + | string intended to match, or be matched by, one or more other strings.  | ||
| + | pattern will usually contain one or more wildcards, but it doesn' | ||
| + | |||
| + | The following wildcard characters are supported: | ||
| + | |||
| + | |*   | matches zero or more characters  | ||
| + | |%   | matches zero or more characters, except spaces  | ||
| + | |?   | matches exactly one character  | ||
| + | |||
| + | Assuming we have a variable $foo set to "hello there": | ||
| + | |||
| + | |hello*  | ||
| + | |hello%  | ||
| + | |hello%? | ||
| + | |h? | ||
| + | |||
| + | Patterns may also contain multiple " | ||
| + | a match attempt is made. Branches are formed with the \\[ \\] construct. | ||
| + | For example: | ||
| + | |||
| + |     | ||
| + | |||
| + | The branching construct may be used anywhere that wildcards are used, | ||
| + | including the various pattern matching functions, and in hook events. | ||
patterns.txt · Last modified: 2006/08/29 16:08 by 127.0.0.1
                
                