help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: match regexp to list elements


From: evan
Subject: Re: match regexp to list elements
Date: Wed, 08 Dec 2010 15:09:38 -0000
User-agent: G2/1.0

That was very helpful. Thanks.

On May 22, 7:22 pm, Andreas Politz <poli...@fh-trier.de> wrote:
> evan <evange...@gmail.com> writes:
> > Hi all, I want to locate all elements of a list that match a regexp.
> > Say I want to write the function match-list-regexp such as if
> > my-list = '(a1 b2 a3 b4)
> > then
> > (match-list-regexp "a[0-9]" my-list)
> > should give '(0 2)
>
> > I though I could use function string-match but I need a way of
> > converting the elements of a list into strings. Any ideas?
> > Thanks.
> > Evan.
>
> - `symbol-name' for symbols (as in your example)
> - `(format "%s" object)' for any kind of lisp-object
>
> -ap



reply via email to

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