Subject: Re: how to get groups out of match-regexp
From: Erik Naggum <erik@naggum.net>
Date: 2000/08/09
Newsgroups: comp.lang.lisp
Message-ID: <3174808983514646@naggum.net>

* Charlie Benton <bentonc@mail.utexas.edu>
| Let's say I want to extract the first group from the regular expression
| "author: \\(\\w+\\);".  Documentation told me that if I set the :return
| argument to :string then match-regexp would return a list where the
| first group would be the 3rd member.

  Documentation told you that?  That's pretty weird.  The same
  documentation tells me that the third _value_ is the first group.
  At least if we're talking about the match-regexp that comes with in
  Allegro CL.

| But the commmand (print (nth 2 (match-regexp "author: \\(\\w+\\);" "asdf
| author: bentonc;" :return :string))) gives me an error.  What am I doing
| wrong.

  Try nth-value instead of nth.  (I would suggest you drop the print,
  too, if you're doing this interactively.)

#:Erik
-- 
  If this is not what you expected, please alter your expectations.