🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #45661

Re: Attack of the Killer Articles pt. 2: Need help with regular expression

#45661
From: Greg Berigan
Date: Sun, 03 Jan 1999 00:00
62 lines
3671 bytes
In article <MPG.10f8e9c6277485ec989750@news.earthlink.net>,
relayer@iname.com (Roy DeRousse) wrote:

> Some of you may remember a problem I discovered last month.  Gravity 
> chokes on certain SPAM articles when it tries to decode them.  They cause 
> the program to crash.  My only solution has been to add them to the bozo 
> bin.  Recently, the number of these Killer Articles (KA) has increased 
> dramatically, and it is a real pain to 1) add a subject to the bozo bin,  
> 2) restart the decoding, 3) crash, and 4) keep repeating the cycle.  I 
> would like to make a general purpose rule to kill these KAs before they 
> kill me!
> 
> Fortunately, the spammers are consistent with their subjects.  Here is an 
> example:
> 
>   io7y   S E E  M Y  G I R L F R I E N D
> 
> They start off with some gibberish, followed by some spaces, followed by 
> a double-spaced subject in caps.  I want to create a regular expression 
> that does this:  "Mark article as read if subject contains a capital 
> letter, followed by a space, followed by a capital letter, followed by 
> two spaces, followed by a capital letter, followed by a space, followed 
> by a capital letter."  I am having trouble creating such an expression.  
> Here is onen of my attempts:
> 
>   Subject contains reg. expr. "[A-Z][ ][A-Z][ ][ ][A-Z][ ][A-Z]"
> 
> It didn't find any matches.

Because it doesn't match.  You want something like:

    .*([A-Z] +)+.*

This matches anything which has at least one instance of patterns of
single capital letters followed by one or more spaces.  If you want to be
more specific:

    [a-z0-9]* +([A-Z] +)+.*

That will match the gibberish followed by one or more spaces followed by a
present pattern of capital letters followed by spaces.

There may be other equivalent regular expressions that your software can
evaluate faster than these.  You may want to tailor them further to
require at least three instances of the pattern so it doesn't match anyone
you uses a single letter capital letter anywhere in their subject.

If you can, use another newsreader that doesn't crash and capture all the
headers of an offending article.  (A DejaNews reference would help, but an
actual copy is better since DejaNews doesn't disclose all headers.) 
Gravity shouldn't crash on bizarre input, but the input needs inspection. 
It may be possible to tailor a killfile entry on something other than the
subject which would target these problem articles directly, such as on
Message-ID or References.

-- 
         ,=<#)-=#  <http://incolor.inetnebr.com/wotw/> (The War of the Worlds)
    ,_--//--_,
 _-~_-(####)-_~-_  "Did you see that Parkins boy's body in the tunnels?" "Just
(#>_--'~--~`--_<#)  the photos.  Worst thing I've ever seen; kid had no face."

Technical Details
Message-ID: <gberigan-0301991045350001@lin-pm2-010.inetnebr.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <MPG.10f8e9c6277485ec989750@news.earthlink.net>

Show Full Headers
Complete Article Headers
Message-ID: <gberigan-0301991045350001@lin-pm2-010.inetnebr.com>
Subject: Re: Attack of the Killer Articles pt. 2: Need help with regular expression
Date: Sun, 03 Jan 1999 00:00:00 +0000
From: gberigan@cse.unl.edu (Greg Berigan)
References: <MPG.10f8e9c6277485ec989750@news.earthlink.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 428336543
X-Face: &@UA7$)=n9C7!qu%-5s},3tR@NEy+B>8PW"^,8?A>%."0{J2c1Yr]NKw';5/( J\r@/{UADjCdE~iRnOEOfbre(/1Y=$TS3Wt7B`a4sz,<EEumhL.DtryQ+!QoI8LE-v.s ;?26oj<q7"[b?Ouo
Organization: http://incolor.inetnebr.com/wotw/ (War of the Worlds)
User-Agent: MT-NewsWatcher/2.4.4
Newsgroups: news.software.readers