chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] string-search vs. string-match


From: felix winkelmann
Subject: Re: [Chicken-users] string-search vs. string-match
Date: Wed, 1 Nov 2006 13:18:26 +0100

On 11/1/06, Dan <address@hidden> wrote:
Hi folks,

I thought string-match (in unit regex) was supposed to
match a regexp at the beginning of a string, while
string-search would *search* for that regexp. At least
that's what the manual seems to say. But

csi> (string-match (regexp "(a*)(b*)") "xxaabb")
("" "" "")
csi> (string-search (regexp "(a*)(b*)") "xxaabb")
("" "" "")
csi> (string-search (regexp "(a*)(b*)") "aabb")
("aabb" "aa" "bb")


The regular expression (a*)(b*) matches the empty string.
Replacing "*" with "+" will make your example work.


cheers,
felix
--
http://galinha.ucpel.tche.br:8081/blog/blog.ssp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]