From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: email extraction in emacs Date: Fri, 01 Dec 2006 13:20:20 +0100 Message-ID: References: <1164819237.355277.217960@j72g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1164976872 30987 80.91.229.2 (1 Dec 2006 12:41:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 1 Dec 2006 12:41:12 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 01 13:41:09 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gq7hK-0001C5-Pf for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Dec 2006 13:40:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gq7hK-0004WM-Bf for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Dec 2006 07:40:58 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 23 Original-X-Trace: individual.net /hitJY/8Dk+ltMqdvvrdsAMp2x14tK3iP+xcm/7KubEY7ssC/c User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.90 (windows-nt) Cancel-Lock: sha1:IRL4JPIui76iWB+UJnJva78ojm8= Original-Xref: shelby.stanford.edu gnu.emacs.help:143567 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:39169 Archived-At: "B. T. Raven" writes: >> (defun blah () >> (let (adresses) >> (while (search-forward-regexp "\\(REGEXP-MATCHING-EMAILS\\)" nil t) >> (setq addresses (append adresses (list (match-string 1))))) >> adresses) >> > This sort of works interactively, that is it finds most of them. Blah is > missing a final parenthesis and I don't understand if addresses with 2 d's > is outside the scope of the let or not. Anyway, it just returns a list of > nils even if some email addresses are below the point of invocation in > *scratch. Yes, there were typos in the code. There should be only one variable, `addresses'. > \b[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]\{2,4\}\b > > Maybe all of the backslashes have to be doubled. If they are in a string, yes.