From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/36684 Path: main.gmane.org!not-for-mail From: wmperry@gnu.org (William M. Perry) Newsgroups: gmane.emacs.gnus.general Subject: Re: header-action.el related. Date: 21 Jun 2001 22:07:34 -0500 Sender: wmperry@aventail.com Message-ID: <86g0ctkya1.fsf@hel.bp.aventail.com> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035172231 9920 80.91.224.250 (21 Oct 2002 03:50:31 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:50:31 +0000 (UTC) Cc: ding@gnus.org Return-Path: Return-Path: Original-Received: (qmail 27608 invoked from network); 22 Jun 2001 03:08:02 -0000 Original-Received: from femail19.sdc1.sfba.home.com (24.0.95.128) by gnus.org with SMTP; 22 Jun 2001 03:08:02 -0000 Original-Received: from hel.bp.aventail.com ([24.12.70.142]) by femail19.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20010622030759.DZMY4833.femail19.sdc1.sfba.home.com@hel.bp.aventail.com>; Thu, 21 Jun 2001 20:07:59 -0700 Original-Received: from hel.bp.aventail.com (wmperry@localhost [127.0.0.1]) by localhost (8.12.0.Beta10/8.12.0.Beta10/Debian 8.12.0.Beta10) with ESMTP id f5M37ZSP001118; Thu, 21 Jun 2001 22:07:35 -0500 Original-Received: (from wmperry@localhost) by hel.bp.aventail.com (8.12.0.Beta10/8.12.0.Beta10/Debian 8.12.0.Beta10) id f5M37Yg1001114; Thu, 21 Jun 2001 22:07:34 -0500 X-Authentication-Warning: hel.bp.aventail.com: wmperry set sender to wmperry@gnu.org using -f Original-To: Jinhyok Heo X-Now-Listening-To: Rednex - The Way I Mate [Radio Version] X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7 (Jinhyok Heo's message of "22 Jun 2001 10:47:51 +0900") User-Agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.4 (Academic Rigor) Original-Lines: 47 Xref: main.gmane.org gmane.emacs.gnus.general:36684 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:36684 Jinhyok Heo writes: > I want to use different signature depending on some header, e.g. To or > From. And I found header-action.el would satisfy me. But I got some > problem with regexp. Help me! > I wanted to use '.signature' with the addresses containing 'abc.com' and > 'def.com'. And I want to use '.signature_2' otherwise. > > I cannot express that with lisp regexp. I thought it would be > '[^(abc.com)]|[^(def.com)]' with some back slashes. I tried many > possible combinations, but it failed. > > My configuration is similar with the following: > > ;;; my header-action setting > (setq header-action-list > '( > ("\\(From\\|To\\|Cc\\|Reply-to\\):" > ("\\(abc\\.com\\|def\\.com\\)" The problem is that header-action sticks the \\( and \\) around your regular expression for you, so you end up with: ^\\(From\\|To\\|Cc\\|Reply-to\\):\\s-*.*\\(\\(abc\\.com\\|def\\.com\\)\\)$ The extra () grouping shouldn't be too big of a problem, but that $ might... If you are replying to someone and their email address looks like: To: William M. Perry It won't match because of the '>' at the end of the line. If you sent to just wmperry@abc.com it would probably work. It looks like you need to construct your regular expression so that it includes things _after_ the email address as well. What if you use: \\(abc\\|def\\)\\.com.* This is all just from a quick perusal of the header-action.el code - don't sue me if I'm wrong. :) -bp -- Ceterum censeo vi esse delendam