From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/18583 Path: news.gmane.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: gmane.emacs.gnus.user Subject: Re: Using `all.SCORE' @ ~/News/all.SCORE [regex syntax] Date: Mon, 29 May 2017 11:34:07 +0100 Message-ID: <8737bo3qao.fsf@bsb.me.uk> References: <8660gmgxdx.fsf@local.lan> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1496056376 17242 195.159.176.226 (29 May 2017 11:12:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 29 May 2017 11:12:56 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cc: info-gnus-english@gnu.org To: Harry Putnam Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Mon May 29 13:12:50 2017 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFIbR-0004Ff-GC for gegu-info-gnus-english@m.gmane.org; Mon, 29 May 2017 13:12:49 +0200 Original-Received: from localhost ([::1]:48080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFIbW-0001eP-Sy for gegu-info-gnus-english@m.gmane.org; Mon, 29 May 2017 07:12:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFIbR-0001e6-Be for info-gnus-english@gnu.org; Mon, 29 May 2017 07:12:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFIbO-000111-4V for info-gnus-english@gnu.org; Mon, 29 May 2017 07:12:49 -0400 Original-Received: from cp161173.hpdns.net ([91.238.161.173]:56622) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dFIbN-0000vB-Qb for info-gnus-english@gnu.org; Mon, 29 May 2017 07:12:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bsb.me.uk; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=t/DaQUqytzRgwljlRJtVgicIgKNaYFxYGpBWenAWIqs=; b=lclB+snfbF9nQz5L9ty5DHwBaW /Zfsximn2mFdyO1bCmJPZmsWeJmSs6GbD3JRT1g1fGisEerFBZ2eF0F/SjtRTNoMW3XWOi77bplTQ mlp2MZXI7SRPWNVHicfYLNvCrVuBluTLd/mIvrnVojMApsiINqJ3531T5HN2b7IiNCNY=; Original-Received: from dsl-217-155-82-182.zen.co.uk ([217.155.82.182]:53296 helo=skinny) by cp161173.hpdns.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1dFHzz-001k0U-JV; Mon, 29 May 2017 11:34:07 +0100 Original-Received: by skinny (masqmail 0.3.5, from userid 1000) id 1dFHzz-1Iq-00; Mon, 29 May 2017 11:34:07 +0100 In-Reply-To: <8660gmgxdx.fsf@local.lan> (Harry Putnam's message of "Sat, 27 May 2017 10:58:02 -0400") X-cPanel-MailScanner-Information: Please contact the ISP for more information X-cPanel-MailScanner-ID: 1dFHzz-001k0U-JV X-cPanel-MailScanner: Found to be clean X-cPanel-MailScanner-SpamCheck: X-cPanel-MailScanner-From: ben.lists@bsb.me.uk X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cp161173.hpdns.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - bsb.me.uk X-Get-Message-Sender-Via: cp161173.hpdns.net: authenticated_id: bsbmeuk/from_h X-Authenticated-Sender: cp161173.hpdns.net: ben.lists@bsb.me.uk X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 91.238.161.173 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: "info-gnus-english" Xref: news.gmane.org gmane.emacs.gnus.user:18583 Archived-At: Harry Putnam writes: > all.SCORE: > > ((mark -100) > ("from" > ("nikolys@gmail" -101 nil r) > ("sina\.com" -101 nil r) > ("@aol\\.com" -101 nil r) > ("@[0-9]+\\.com>" -101 nil r) > ("harry504@gmail" -101 nil r) > ("s[ea]l[el]\\|discount\\|free\\|wholesale\\|paypal" -101 nil r)) > ("subject" > ("~~" -101 nil r) > ("~~\\|>>>\\|\\[A-Z\\]\\{4\\}" -101 nil r) > ("!!\\|free\\|discount\\|wholesale" -101 nil r))) > I want the `free' at the last `from' element to be more restrictive as > it is hitting quite a few false positives due to network name with > various combinations of free with a dot like: `free.', `.free' and > `.free.' > > This is happening in groups with thousands and thousands of messages > so I don't want to get it wrong... not sure how to re-run it. > > So something like (please ignore the elisions (`[...]')): > > [...] |[^\.]free[^\.]\\|[...] It's simpler than you think because . does not need \ inside []s. All you need to add is [^.] on either side. > But does it need the double slashes like: > > [...] |\\[^\.\\]free\\[^\.\\] [...] > ^^ ^^ ^^ > Will that even accomplish what I am after; to allow `free' in any > combination of: `.free', `free.' or `.free.' to not be down scored? You've added \s only where not needed! There are two things going on that require \s. First, some elements i a regexp only mean what you want when preceded by \. So | is just | unless you write \| to mean an alternative. But then the regexp is being put into a string, and \s need to be doubled inside a string so that they remain \s. So, if you did need [^\.] (you don't) you'd have to write "... [^\\.] ..." in a string. > Is there a handy way to test the regex? I use highlight mode. Text matching your regexp gets highlighted in real time. Remember, get the regexp working, then double every \ to put it into a string. > Is there a handy way to rerun all those messages thru `all.SCORE'? I think just exiting and re-entering the group does that, though I'm sure there will be some more direct way. -- Ben.