From: Charlie Benton
Subject: Need help with Allegro match-regexp
Date: 
Message-ID: <3991D29F.F38828A0@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.

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

By the way I am using Allegro Lisp which has it's own support for
regular expressions, and the documentation say that it supports group
extraction.

Thanks,
  Charlie Benton (·······@mail.utexas.edu)

From: Erik Naggum
Subject: Re: Need help with Allegro match-regexp
Date: 
Message-ID: <3174896826913291@naggum.net>
* Charlie Benton <·······@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.

  Could you quote that documentation, please?

  And didn't you just post this question a few days ago?

#:Erik
-- 
  If this is not what you expected, please alter your expectations.
From: Steven M. Haflich
Subject: Re: Need help with Allegro match-regexp
Date: 
Message-ID: <399EC3AE.D1EE10D0@pacbell.net>
Charlie Benton wrote:

I find your expression of your thinking very fuzzy.  Fuzzy thinking is
not condusive to debugging.

> 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.
> 
> But the commmand (print (nth 2 (match-regexp "author: \\(\\w+\\);" "asdf

Common Lisp does not have commands.  (ACL does have something called
commands, but that is something different.)  Common Lisp has functions,
and if you think about functions you might be able to debug this.

> author: bentonc;" :return :string))) gives me an error.  What am I doing
> wrong.

If it gives _you_ an error you should see a physician or mechanic.
If, on the other hand, the execution of the form signals an error,
you should look at error which will be very explicit about which
function is complaining about which arguments.  You should then
be able to debug the nested function alls and find your error,
which is actually quite obvious...  Hint:  Always simplify a form
when it doesn't do what you expect/intend.
From: Christopher R. Barry
Subject: Re: Need help with Allegro match-regexp
Date: 
Message-ID: <87g0o0lb8v.fsf@2xtreme.net>
"Steven M. Haflich" <·······@pacbell.net> writes:

> Charlie Benton wrote:
> 
> I find your expression of your thinking very fuzzy.  Fuzzy thinking is
> not condusive to debugging.

But fuzzy thinking _is_ conducive to debugging. :-)

Christopher