PatternMatch(39.0) ARP Programmers Manual PatternMatch(39.0) ADDENDUM FOR PatternMatch - perform a wildcard match on a string FUNCTION The PatternMatch() wildcard characters have been changed in the V39.0 (V1.3 of ARP) release. Two of the unimplemented wildcard characters specified in the earlier ARP releases have been removed, and one new wildcard character has been implemented. Gone are the {} bracket characters, which were previously reserved for use as tags for a replace function. These characters had been translated to wildcard tokens in prior releases, which caused problems with some commercial software packages that used the bracket characters (notably Word Perfect). The new implementation resolves this collision. Also gone is the character class NOT construct, which was specified by the characters [^]. Character classes are now properly implemented using [] bracket characters, but the NOT character class construct is gone. Instead of the NOT character class, there is a generalized NOT operator, specified with the TILDE character ~. When the NOT operator is specified, any pattern following the NOT character must NOT be matched in order to return "true". This is most useful for specifying something like "All files that do NOT end in .info", which can be represented by: ~*.info A caution in the current implementation of NOT, users should be aware that any TILDE character is translated to a NOT token, and thus attempting to specify a literal TILDE character must be escaped. This is a particular issue for users of MicroEmacs, which creates files that end in a tilde character. For instance, if you use the command: >1 Delete *~ That will delete ALL files, rather than deleting all files that end with the TILDE character. That is because the NOT operator requires a non-match on any following pattern. In order to actually delete all files ending in TILDE, you must use: 1> Delete *'~ This command uses the wildcard pattern ESCAPE character (the single quote) to force the TILDE to be interpreted literally. A future implementation of the wildcard specs is likely to have two changes from the V39 arp.library implementation. Page 1 (printed 10/16/89) PatternMatch(39.0) ARP Programmers Manual PatternMatch(39.0) The first change will be to limit the scope of the NOT operator, such that it will have the same scope as the # "Match zero or more instances of the following substring" operator. Thus, the NOT operator would match "Exactly zero instances of the following substring". Substrings are grouped as either the following character, or the following wildcard token (such as a character class, or an OR clause). The second change will be to interpret a trailing TILDE character literally, since there is no following pattern to match. This is intended to resolve the collision with the TILDE character in MicroEmacs. These possible enhancements have been mentioned here to assist applications developers who may want to use the NOT operator within their applications programs. In particular, it would be advisable to use: ~(*.info) instead of: ~*.info if you want to use the NOT operator for wildcard patterns.