Gnus development mailing list
 help / color / mirror / Atom feed
From: Emanuel Berg <moasenwood@zoho.eu>
To: ding@gnus.org
Subject: Re: how to extract the content of a cc field
Date: Sat, 20 Mar 2021 05:38:48 +0100	[thread overview]
Message-ID: <871rcal9rb.fsf@zoho.eu> (raw)
In-Reply-To: <87o8forq27.fsf@mat.ucm.es>

Uwe Brauer wrote:

> So 
>
> For example 
>
> Cc: user1 <user1@gmail.com>, user2 <user2@gmx.net>
>
> Extracts user1 <user1@gmail.com>, user2 <user2@gmx.net>
>
> Has to be expected. 
>
> Would it be possible to extract
>
> Ccname user1
> ccfrom user1@gmail.com

I once did something similar:

;;; -*- lexical-binding: t -*-
;;;
;;; this file:
;;;   http://user.it.uu.se/~embe8573/emacs-init/match-data-format.el
;;;   https://dataswamp.org/~incal/emacs-init/match-data-format.el

(defun make-match-list (num string)
  (let ((match (match-string num string)))
    (when match (cons match (make-match-list (1+ num) string))) ))

(defun match-data-format (data match format-str)
  (save-match-data
    (string-match match data)
    (apply #'message format-str (make-match-list 1 data)) ))

(when nil
    (match-data-format
     "From: Joe Hacker <get@this.data>"
     "\\(.*\\): *\\(.*[[:alnum:]]\\) *<\\(.*\\)>"
     "header is: %s\nname is: %s\ne-mail is: %s")
    )                                          ; ^eval me

;; output from eval'd command:
;;
;; header is: From
;; name is: Joe Hacker
;; e-mail is: get@this.data


-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal



  parent reply	other threads:[~2021-03-20  4:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 18:52 Uwe Brauer
2021-03-12 19:08 ` Eric Abrahamsen
2021-03-12 21:59   ` Uwe Brauer
2021-03-14 10:53     ` Robert Pluim
2021-03-20  4:38     ` Emanuel Berg [this message]
2021-03-14 21:26   ` [UTF8 problems] (was: how to extract the content of a cc field) Uwe Brauer
2021-03-15 23:22     ` [UTF8 problems] Eric Abrahamsen
2021-03-16 11:29       ` Uwe Brauer
2021-03-16 17:26         ` Eric Abrahamsen
2021-03-16 21:02           ` Uwe Brauer
2021-03-16 21:18             ` Eric Abrahamsen
2021-03-18 12:15           ` [if cc is empty?] (was: [UTF8 problems]) Uwe Brauer
2021-03-18 15:37             ` [if cc is empty?] Eric Abrahamsen
2021-03-18 21:25               ` Uwe Brauer
2021-03-12 19:11 ` how to extract the content of a cc field Andreas Schwab
2021-03-12 19:17   ` Eric Abrahamsen
2021-03-14 21:27   ` Uwe Brauer
2021-03-15 23:08     ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rcal9rb.fsf@zoho.eu \
    --to=moasenwood@zoho.eu \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).