[Top][All Lists]

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

Re: email extraction in emacs

From: Mathias Dahl
Subject: Re: email extraction in emacs
Date: Thu, 30 Nov 2006 14:01:49 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.90 (windows-nt)

"a" <address@hidden> writes:

> if i have a text file filled with email addresses but other things
> as well what commands can i use to extract the email address from
> the file?

You would probably need `search-forward-regexp' and
`match-string'. The code below will not work but it will give you an
idea on how to do it:

(defun blah ()
 (let (adresses)
  (while (search-forward-regexp "\\(REGEXP-MATCHING-EMAILS\\)" nil t)
   (setq addresses (append adresses (list (match-string 1)))))

Matching e-mail addresses using a regexp can be tricky, if you want to
support all variants (with `+' before the @ and such).

reply via email to

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