From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10620 invoked from network); 20 Mar 2021 04:39:22 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 20 Mar 2021 04:39:22 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lNTOO-002gHi-Fx for ml@inbox.vuxu.org; Fri, 19 Mar 2021 23:39:16 -0500 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1lNTON-002BE3-RM for ml@inbox.vuxu.org; Fri, 19 Mar 2021 23:39:15 -0500 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lNTOL-002BDu-M9 for ding@lists.math.uh.edu; Fri, 19 Mar 2021 23:39:13 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lNTOI-002oHT-Bg for ding@lists.math.uh.edu; Fri, 19 Mar 2021 23:39:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:Mime-Version:References:Message-ID:Date:Subject: From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+Rn/M/z37vO4Ui+K0OZVYhlsEj5ZFwqzzonYSJiOyQs=; b=hGplrApkJ0ofxhEFfbk301Peq9 ZPHv+IeRn+jL/htFMrFB6bykE6q23d/7puwa3/R7Z5R8xO5NLM/Dpf3AWOz9iU8kl/tORl0QsnbUD pP/uk7hjPqMxHhBtTUzzppeH4CrKeTUaaNNGPI4eTgUVHXUdXWBthlR5cXh8R1qbcDzs=; Received: from ciao.gmane.io ([116.202.254.214]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNTO3-0000Y7-7G for ding@gnus.org; Sat, 20 Mar 2021 05:39:05 +0100 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1lNTO0-0003yx-R6 for ding@gnus.org; Sat, 20 Mar 2021 05:38:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org To: ding@gnus.org From: Emanuel Berg Subject: Re: how to extract the content of a cc field Date: Sat, 20 Mar 2021 05:38:48 +0100 Message-ID: <871rcal9rb.fsf@zoho.eu> References: <87v99wfbmq.fsf@mat.ucm.es> <87zgz8tckb.fsf@ericabrahamsen.net> <87o8forq27.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:p0rjLQ3ROPVlfPx118qb3TIOVLY= Mail-Copies-To: never List-ID: Precedence: bulk Uwe Brauer wrote: > So > > For example > > Cc: user1 , user2 > > Extracts user1 , user2 > > 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 " "\\(.*\\): *\\(.*[[: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