From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/54042 Path: main.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: How to split on content-length? Date: Wed, 24 Sep 2003 07:00:25 -0400 Organization: =?koi8-r?q?=F4=C5=CF=C4=CF=D2=20=FA=CC=C1=D4=C1=CE=CF=D7?= @ Cienfuegos Sender: ding-owner@lists.math.uh.edu Message-ID: <4nad8ufo3a.fsf@lockgroove.bwh.harvard.edu> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1064401257 11089 80.91.224.253 (24 Sep 2003 11:00:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 24 Sep 2003 11:00:57 +0000 (UTC) Cc: ding@gnus.org Original-X-From: ding-owner+M2582@lists.math.uh.edu Wed Sep 24 13:00:55 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A27OB-0007Xu-00 for ; Wed, 24 Sep 2003 13:00:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1A27O1-0005ki-00; Wed, 24 Sep 2003 06:00:45 -0500 Original-Received: from justine.libertine.org ([66.139.78.221]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1A27Nx-0005kd-00 for ding@lists.math.uh.edu; Wed, 24 Sep 2003 06:00:41 -0500 Original-Received: from clifford.bwh.harvard.edu (clifford.bwh.harvard.edu [134.174.9.41]) by justine.libertine.org (Postfix) with ESMTP id 1B8793A004C for ; Wed, 24 Sep 2003 06:00:40 -0500 (CDT) Original-Received: from lockgroove.bwh.harvard.edu (lockgroove [134.174.9.133]) by clifford.bwh.harvard.edu (8.10.2+Sun/8.11.0) with ESMTP id h8OB0V710962; Wed, 24 Sep 2003 07:00:31 -0400 (EDT) Original-Received: (from tzz@localhost) by lockgroove.bwh.harvard.edu (8.11.6+Sun/8.11.0) id h8OB0Pi01197; Wed, 24 Sep 2003 07:00:25 -0400 (EDT) Original-To: Tom Koelman X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Followup-To: Tom Koelman , ding@gnus.org In-Reply-To: (Tom Koelman's message of "Wed, 24 Sep 2003 08:44:08 +0200") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (usg-unix-v) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:54042 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:54042 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