regular expression library
Neel Krishnaswami <[email protected]> Tue, 24 Sep 2002 10:31:26 -0400 (EDT)
| Newsgroups | gmane.comp.lang.goo.general |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
I just added a regular expression matcher to the GooLibs part of the
GOO wiki. Quoting from the header comments:
This module implements regular expression matching. These regexps
don't need to be compiled before they can be matched against input.
They can also match patterns of arbitrary objects in arbitrary
sequences. Right now the main drawback is that no subexpression
matching is possible to get substrings.
Examples:
(match? (re-alt (re-seq "foo") (re-seq "bar")) "foo") => #t
(match? (re-alt (re-seq "foo") (re-seq "bar")) "baz") => #f
(match? (re-cat (re-star (re-sym 'foo)) (re-sym 'bar))
'(foo foo bar)) => #t
--
Neel Krishnaswami
[email protected]