S9 LIB  (re-comp string)              ==>  list
        (re-match list string)        ==>  list | #f
        (re-match list string 'lazy)  ==>  list | #f

Compile and match regular expressions.

RE-COMP compiles a regular expression (RE) and returns it.
Compiled REs (CREs) are represented by lists.

RE-MATCH matches a compiled RE against a string. When (part of) the
string matches the CRE, it returns a list of the form

      ((first limit) ...)

where FIRST is the index of the first character matching the RE and
LIMIT is the first character *after* the match (so the match can be
extracted with SUBSTRING). When no submatches are used, just a list
of the form ((first limit)) will be returned. When submatches using
\( and \) are contained in the regular expression, the subsequent pairs
will contain the ranges matched by the sub-expressions (in the order of
sub-expressions in the RE). See examples.

When the CRE does not match the string, RE-MATCH returns #F.

A special case occurs when a given pattern may match a string of zero
length. In this case, RE-MATCH returns () when no better match could
be found.

When 'LAZY is passed as the last argument to RE-MATCH, it matches
repetitions lazily, e.g.: "A+" will match "A" (rather than "AAA")
in "AAAB".

The following RE patterns are evaluated:
.          match any character
[char...]  match character class (may contain ranges of the form c1-c2)
^          match beginning of line
$          match end of line
*          match zero or more instances of the preceding pattern
+          match one or more instances of the preceding pattern
?          match the preceding pattern optionally
\          match the following character literally (exception below!)
\(         mark the beginning of a submatch
\)         mark the end of a submatch

(re-match (re-comp "^a[1-9]*z$") "a1289z")     ==>  ((0 6))
(re-match (re-comp "a[1-9]+z") "___a123z___")  ==>  ((3 8))
(re-match (re-comp "a[^1-9]+z") "a123z")       ==>  #f
(re-match (re-comp "[1-9]*") "__1__")          ==>  ((2 3))
(re-match (re-comp "[1-9]*") "_____")          ==>  ()
(re-match (re-comp "f\\(.\\)\\(.\\)bar")
          "foobar")                      ==>  ((0 6) (1 2) (2 3))
