Extending APL for pattern matching
Abstract
APL includes a few primitives to permit searching of strings for single characters, principally the dyadic iota. APL2 adds iota underline. This latter function will find all occurrences of a given string in a longer string. Sometimes, however, more elaborate searching is needed; for example, searching for strings of variable length, searching for any of several alternate strings and avoiding of particular strings. In this paper, we describe two APL functions which permit very general string searching and substitution. Patterns describing the search to be done are written in APL with extended syntax. They are converted into a mixture of standard APL and defined functions and executed. The facility described is in experimental use as part of a macro language for the experimental full-screen editor ED3 [1].