[plt-scheme] regexp multiple matches?

From: Noel Welsh (noelwelsh at yahoo.com)
Date: Wed Jan 8 05:19:59 EST 2003

--- Anton van Straaten <anton at appsolutions.com> wrote:
> Unless I'm missing something, regexp-match and
> pregexp-match don't seem
> geared towards collecting all occurrences of a
> pattern in a string.  

In MzLib string.ss:

(regexp-match* pattern str [start-k end-k])     

Like regexp-match (see section 10 in PLT MzScheme:
Language Manual), but the result is a list of strings
corresponding to a sequence of matches of pattern in
str. (Unlike regexp-match, results for parenthesized
sub-patterns in pattern are not returned.) If pattern
matches a zero-length string along the way, the
exn:user exception is raised.

If str contains no matches (in the range start to
end), null is returned. Otherwise, each string in the
resulting list is a distinct substring of str that
matches pattern.

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

Posted on the users mailing list.