This function compiles a regular expression into a callable object. The valid forms of regular expressions are given in the table at the beginning of this section.
The second return value, list
, describes the values that
will be returned from proc
when it finds a match. The
first element is always the symbol substring, indicating
that the proc returns the start and end index of the substring
that matched. The remaining elements are the names from each
occurrence of a let form in expr
, indicating the
strings returned for each use of let. let's without
names are assigned integer names 1, 2, 3, ...
[really, save is the appopriate choice for unnamed let's]
If the proc
finds a match, it return two values --
the start and end index of the substring that matched --
plus one string for each let construct in
the regular expression.
Since the proc
returns multiple values, the bind
construct may be used to capture the multiple values.