all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: torys.anderson@gmail.com (Tory S. Anderson)
To: help-gnu-emacs@gnu.org
Subject: Re: cleaning up a big regexp
Date: Mon, 15 Sep 2014 07:26:17 -0400	[thread overview]
Message-ID: <87egvdunty.fsf@gmail.com> (raw)
In-Reply-To: <slrnm1diok.r9g.joost.m.kremers@j.kremers4.news.arnhem.chello.nl> (Joost Kremers's message of "15 Sep 2014 11:18:44 GMT")

That command would shrink the regexp and make it more efficient, but my goal here is to be able to more easily read and append to it, rather than optimize it. I would like to be able to have a list, maybe something like:

("^From:.*" ((".*@bulk1.com")
          (".*@bulk2.com")
          (".*@bulk3.com")))

I'm new enough to [e]lisp that I'm not sure what list->string concatenation functions would do the trick here. 

Joost Kremers <joost.m.kremers@gmail.com> writes:

> Tory S. Anderson wrote:
>> Using gnus I have a growing regexp that represents the criteria for bulk email and splits accordingly:
>
> [...]
>
>> Is there a way to clean this up to make it both more readable and more
>> easily editable? It seems like keeping some kind of list would be the
>> way to do it, instead of an ever-lengthening string.
>
> 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?



  reply	other threads:[~2014-09-15 11:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.8887.1410779723.1147.help-gnu-emacs@gnu.org>
2014-09-15 11:18 ` cleaning up a big regexp Joost Kremers
2014-09-15 11:26   ` Tory S. Anderson [this message]
2014-09-15 11:41   ` Michael Albinus
2014-09-15 12:06     ` Tory S. Anderson
2014-09-15 12:18       ` Michael Albinus
2014-09-15 12:36       ` Stefan Monnier
2014-09-15 14:11         ` Michael Albinus
2014-09-15 14:42           ` Thanks! " Tory S. Anderson
2014-09-15 19:00           ` Stefan Monnier
2014-09-16 11:05             ` Regexp in nnmail-split-methods (was Re: cleaning up a big regexp) Tory S. Anderson
     [not found]             ` <mailman.8968.1410865533.1147.help-gnu-emacs@gnu.org>
2014-09-16 12:33               ` sokobania.01
2014-09-17 21:20                 ` RESOLVED " Tory S. Anderson
2014-09-15 11:15 cleaning up a big regexp Tory S. Anderson
2014-09-15 11:25 ` Eric Abrahamsen
2014-09-15 14:35 ` Thorsten Jolitz

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=87egvdunty.fsf@gmail.com \
    --to=torys.anderson@gmail.com \
    --cc=help-gnu-emacs@gnu.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.