🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nn
Article #5471

Re: How to kill subject with only Capitals & Punctuation?

#5471
From: Nancy McGough
Date: Fri, 18 Feb 1994 00:47
50 lines
2712 bytes
>>dlyons@unix1.tcd.ie (Donal Lyons) writes:
>>>I've been using Nancy McGough's solution until now and it seemed to work
>>>perfectly but have just come across a subject that I'd have expected to
>>>be suppressed and it wasn't.  The subject in question was:
>>>BEST "PROOF" OF "HOLOCAUST GASSINGS" IS PHONY!
>>>
>>>I'd expected that the kill file line
>>>:!s/=:^[^a-z]*$
>>>would have suppressed a subject which included no lower-case  character
>>>but the above is a counter-example.


>In <2jrj0d$oua@nwfocus.wa.com> Nancy McGough <nancym@ii.com> writes:
>>I also would
>>have guessed that the regexp ^[^a-z]*$ would have caught the
>>above subject since no character is in the range a-z.  My guess
>>is that punctuation is treated differently.


dwolfe@pffft.sps.mot.com (Dave Wolfe) writes:
>TFM says that the equal sign, as in :!s/=:, means the matching is case-
>insensitive, i.e. converts the subject to lower-case before matching.

I think this is what TFM means (but it's not very clearly stated) 
about the four combinations of / and =.

Exp   Match if string is....
===   ======================
/=    regexp in target, case sensitive
/     regexp in target, case insensitive
=     exactly the target, case sensitive
      in target, case insensitive

Both Donal and I have tested ^[^a-z]*$ and it does indeed match only
all upper case targets (subject or name depending on whether s or n
is specified).  


>Note that `*' means "zero or more", so this RE also matches null
>subjects: if you don't want that behavior, use `+' instead (assuming
>nn really implements all egrep RE features; I haven't tried this).
>Therefore, what you really want is:
>
>    :!s/:^[^a-z]+$

Good point but I think it should be:
     :!s/=:^[^a-z]+$

Thanks,
Nancy
Technical Details
Message-ID: <2k136f$kro@nwfocus.wa.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmd.de!xlink.net!howland.reston.ans.net!cs.utexas.edu!uunet!nwnexus!nancym
References: <dlyons.761226723@unix1.tcd.ie> <2jrj0d$oua@nwfocus.wa.com> <dwolfe.761425645@pets.sps.mot.com>

Show Full Headers
Complete Article Headers
Message-ID: <2k136f$kro@nwfocus.wa.com>
Subject: Re: How to kill subject with only Capitals & Punctuation?
Date: Fri, 18 Feb 1994 00:47:11 +0000
From: Nancy McGough <nancym@ii.com>
References: <dlyons.761226723@unix1.tcd.ie> <2jrj0d$oua@nwfocus.wa.com> <dwolfe.761425645@pets.sps.mot.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmd.de!xlink.net!howland.reston.ans.net!cs.utexas.edu!uunet!nwnexus!nancym
Newsgroups: news.software.nn,comp.unix.questions
Organization: Infinite Ink, Seattle, Washington, USA
Lines: 51
Sender: news@nwfocus.wa.com
Reply-To: Nancy McGough <nancym@ii.com>
NNTP-Posting-Host: nwfocus.wa.com
X-Newsreader: NN [version 6.4.18]
Originator: nancym@coho.halcyon.com