Summary
###########################################################################
File: wildcard.icn
Subject: Procedures for UNIX-like wild-card pattern matching
Author: Robert J. Alexander
Date: September 26, 1990
###########################################################################
This file is in the public domain.
###########################################################################
This is a kit of procedures to deal with UNIX-like filename wild-card
patterns containing *, ?, and [...]. The meanings are as of the
pattern characters are the same as in the UNIX shells csh and sh.
They are described briefly in the wild_pat() procedure.
These procedures are interesting partly because of the "recursive
suspension" technique used to simulate conjunction of an arbitrary
number of computed expressions.
The public procedures are:
wild_match(pattern,s,i1,i2) : i3,i4,...,iN
wild_find(pattern,s,i1,i2) : i3,i4,...,iN
wild_match() produces the sequence of positions in "s" past a
substring starting at "i1" that matches "pattern", but fails if there
is no such position. Similar to match(), but is capable of
generating multiple positions.
wild_find() produces the sequence of positions in "s" where
substrings begin that match "pattern", but fails if there is no such
position. Similar to find().
"pattern" can be either a string or a pattern list -- see wild_pat(),
below.
Default values of s, i1, and i2 are the same as for Icon's built-in
string scanning procedures such as match().
wild_pat(s) : L
Creates a pattern element list from pattern string "s". A pattern
element is needed by wild_match() and wild_find(). wild_match() and
wild_find() will automatically convert a pattern string to a pattern
list, but it is faster to do the conversion explicitly if multiple
operations are done using the same pattern.
Procedures:
wild_find, wild_match, wild_match1, wild_pat, wild_skip
This file is part of the (main) package.
Source code.
wild_find(plist, s, i1, i2)
i3,i4,...,iN
wild_match(plist, s, i1, i2)
i3,i4,...,iN
wild_match1(plist, v)
s1,s2,...,sN
wild_pat(s)
L
wild_skip(plist)
s1,s2,...,sN
This page produced by UniDoc on 2021/04/15 @ 23:59:54.