[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

regular expression library




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
neelk@alum.mit.edu