help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: cleaning up a big regexp


From: Michael Albinus
Subject: Re: cleaning up a big regexp
Date: Mon, 15 Sep 2014 13:41:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Joost Kremers <address@hidden> writes:

> There's the function `regexp-opt', which takes a list of strings and
> returns a regular expression that will match any of those strings.
> Perhaps you can use that?

regexp-opt cannot handle meta characters like "*". The OP showed such a regexp.

Maybe somthing like this works (untested):

(setq my-gnus-bulk-regexp
      (concat
       "^\\(From:.*@"
       (regexp-opt
        '("maillist.codeproject.com"
          "papajohns-specials.com"
          "qomail.quikorder.com"
          "linkedin.com"
          "facebookmail.com"
          "plus.google.com"
          "twitter.com"
          "youtube.com"
          "linguistlist.org"
          "sportsauthority.com")
        'par)
       "\\)\\|\\(To:address@hidden)"))

Best regards, Michael.



reply via email to

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