🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #219249

Re: Regex to detect long subject lines

#219249
From: Mike Dee
Date: Tue, 15 Apr 2008 00:44
43 lines
3089 bytes
Ed <apostle@REMOVETHISpeculiar.homeip.net> wrote:

> I've been trying to come up with a regex that will trap overly
> long subject lines but honestly I'm terrible at regular expression
> syntax 
 
>From the Xnews manual, under the section on Regular Expression:

3) Quantifiers (match how many times)

   *     Match 0 or more times
   +     Match 1 or more times
   ?     Match 1 or 0 time (i.e., optionally match)
   {n}   Match exactly n times
   {n,}  Match at least n times
   {n,m} Match at least n but not more than m times
 
> I'd like to be able to trap any message with a subject line more
> than 60 characters long

The following score, based on the above rules:

%%-----------------------------

[.]

    Score: -100
      Subject: .{60,}

%%-----------------------------

The above will do what you want.

I've given it a score of -100, you can use any number here from -9999 
to 9999

In the keyword line after "Subject", the period "." before the curly 
braces means match any character (inculdes spaces) and within the curly 
braces the comma and space after the number means "match at least n 
times". So this will match any subject of 60 or more characters.

-- 
dee
Technical Details
Message-ID: <Xns9A816D4A1C13Bemteedee@193.201.53.67>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.albasani.net!newsfeed.datemas.de!news.datemas.de!not-for-mail
References: <Xns9A808EE42A7682362352@127.0.0.1>

Show Full Headers
Complete Article Headers
Message-ID: <Xns9A816D4A1C13Bemteedee@193.201.53.67>
Subject: Re: Regex to detect long subject lines
Date: Tue, 15 Apr 2008 00:44:42 +0000
From: Mike Dee <emteedee@invalid.invalid>
References: <Xns9A808EE42A7682362352@127.0.0.1>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.albasani.net!newsfeed.datemas.de!news.datemas.de!not-for-mail
Newsgroups: news.software.readers
Organization: Poor Boy
Lines: 43
Mime-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: news.datemas.de
 VrTbCI2deXE42YHnUi4iwOnO7tH5Ddt7faDPX6dhV/4n8bNTs2ysIPqGiIRCwmp5H2scSpz113Vde2XerZ93To3Xji7ksto1PHnIFDtmbq1g0Cr5W/g9BsGJIJ/LyxuQUTRHR/14FLFl/S1C76cQD3CVRzUDW7nEIu1s9PGu01Y=
X-Complaints-To: abuse@datemas.de
NNTP-Posting-Date: Tue, 15 Apr 2008 00:44:42 +0000 (UTC)
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUAAAA1eFXgkmf71L/7
 7qX////6Pj40AAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH1wMdBh4ZkpuYCAAAAPlJREFU
 eNqV0s2RwyAMBeAXQ+5xB4wq8AwNcHABuWz/rQRJ/AhssrtcPKPPegJjnIuF+vQrwC/QOidIK8AM
 6Qv4W0ADXADaeAO56RZijAeu4GIsMoHU47XDdfAWUlyAjHY6YwKXa+4KZYTsy0JyHFPFQjQdIxxo
 NESh1ccDJmeyzvsZX8D/CWBkAPkedV+LqBl6WPlYBdCOeFiAhdABBg4EvXiGLcj16QQivd8MiaHW
 N6JQARTaIXK9w8bdZQDxkiEKpP8uB00Q8JPXW+qahTPJS69nBk2SlgzS8DBJFrA/e5JkeSTe+WO3
 SdySgd/YGd4b9ZYBaIB/rw/aM8iUyl6QnQAAAABJRU5ErkJggg==
X-Face: $W<X:Uw4$"nTXRHqqZ=.|pFI@K,TNNH0i>-J; N5/yst7]cQb.o^L$oAhs-J!C
 AOUMQ^NHu3aTb9H8awW~4Y.LR`[o}Rz6Xf=^krb-AwUiM"7zA+QR<vWz'8>hKiTOyd]h
 z]7m=[nhuH{NMrE>~][PM`wSKd?TFV-.glh)>N
User-Agent: Xnews/2006.08.24