Subject: [clisp-list] Regexp question.

From: [email-masked] (Thaddeus L. Olczyk)
Date: Wed Jan 23 06:31:22 2002

According to the documentation in rhe regexp manual,
match is supposed to return a list; the first value
is a regex_t describing the whole expression
the subsequent values are regex_t for each subgroup.
Trying this little program,

(use-package "REGEXP")

(setf t1 "abcdefghijklmnop")

(terpri)
(princ (match "abcdef" t1)) 
(terpri)
(princ (regexp:match "ab\\(c\\(def\\)\\)" t1)) 

the second match simply returns one value where if I understood
correctly, it should return three. How do I extract subgroups?

---

From: Sam Steingold <[email-masked]>
Date: Wed Jan 23 11:25:04 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] Regexp question."
> * Sent on Wed, 23 Jan 2002 14:30:44 GMT
> * Honorable [email-masked] (Thaddeus L. Olczyk) writes:
>

not a list, but multiple values

> the subsequent values are regex_t for each subgroup.

please read <http://www.lisp.org/HyperSpec/Body/acc_values.html>
and the "See also" section there.

what you want to use is MULTIPLE-VALUE-BIND.

-- 
Sam Steingold (http://www.podval.org/~sds)
Keep Jerusalem united! <http://www.onejerusalem.org/Petition.asp>
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
Type louder, please.