From: Ted Zlatanov <tzz@lifelogs.com>
Cc: ding@gnus.org
Subject: Re: How to split on content-length?
Date: Wed, 24 Sep 2003 07:00:25 -0400 [thread overview]
Message-ID: <4nad8ufo3a.fsf@lockgroove.bwh.harvard.edu> (raw)
In-Reply-To: <ueky68z47.fsf@assurancetourix.xs4all.nl> (Tom Koelman's message of "Wed, 24 Sep 2003 08:44:08 +0200")
On Wed, 24 Sep 2003, tkoelman@xs4all.nl wrote:
> I don't think this will match anything for wich the last 5 digits
> are a number between 00000 and 39999. But you gave me an idea and I
> modified it to
>
> \\(1[4-9]\\|[2-9][0-9]\\)[0-9]\\{4,\\}
>
> which still has a problem with numbers containing more than 6 digits
> of which the first is a 1 and the second smaller than 4. Adding
> another bit like so
>
> \\(1[4-9]\\|[2-9][0-9]\\|[1-9][0-9][0-9]\\)[0-9]\\{4,\\}
>
> does the trick.
That seems unnecessarily acrobatic. Why not just match the digits and
compare them numerically to the number you want? You can use
string-to-number, something like this might work (set data to the
header of interest and the action to what you want instead of the
message):
(let ((data "19874543435")
(limit 150000))
(when (and (string-match "\\([0-9]+\\)" data)
(> (string-to-number (match-string 1 data)) limit))
(message "saw number greater than %d" limit)))
I would be very careful about using content-length for filtering.
Maybe you should consider doing that only if the message has an
executable attachment.
Ted
prev parent reply other threads:[~2003-09-24 11:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-23 8:54 Tom Koelman
2003-09-23 18:41 ` Hanak David
2003-09-24 1:20 ` Jesper Harder
2003-09-24 6:44 ` Tom Koelman
2003-09-24 11:00 ` Ted Zlatanov [this message]
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=4nad8ufo3a.fsf@lockgroove.bwh.harvard.edu \
--to=tzz@lifelogs.com \
--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).