Thread View: news.software.nn
5 messages
5 total messages
Started by Donal Lyons
Mon, 14 Feb 1994 11:52
How to kill subject with only Capitals & Punctuation?
Author: Donal Lyons
Date: Mon, 14 Feb 1994 11:52
Date: Mon, 14 Feb 1994 11:52
22 lines
1705 bytes
1705 bytes
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. Does anyone have a solution that would kill subjects of the above type? Thanks in advance. -- email dlyons@unix1.tcd.ie Donal Lyons, FAX. +353 1 661 5046 Department of Statistics, Tel. +353 1 702 1759 (1000-1700 GMT) Trinity College, Dublin 2, Tel. +353 1 702 1767 Messages. Ireland. -- email dlyons@unix1.tcd.ie Donal Lyons, FAX. +353 1 661 5046 Department of Statistics, Tel. +353 1 702 1759 (1000-1700 GMT) Trinity College, Dublin 2, Tel. +353 1 702 1767 Messages. Ireland.
Re: How to kill subject with only Capitals & Punctuation?
Author: Nancy McGough
Date: Tue, 15 Feb 1994 22:40
Date: Tue, 15 Feb 1994 22:40
26 lines
1985 bytes
1985 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. > >Does anyone have a solution that would kill subjects of the above type? I'm crossposting this to comp.unix.questions with hopes that a regular expression guru will have an explanation. 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. Any regexp gurus know how to catch subjects like the above that are in all caps and also contain punctuation like " and !? FYI, nn uses egrep-type regexps. Thanks much, Nancy PS - If you refer to me in a post I actually prefer "nancym" to spelling out my full name. Thnx!
Re: How to kill subject with only Capitals & Punctuation?
Author: Dave Wolfe
Date: Wed, 16 Feb 1994 19:07
Date: Wed, 16 Feb 1994 19:07
30 lines
2093 bytes
2093 bytes
In <2jrj0d$oua@nwfocus.wa.com> Nancy McGough <nancym@ii.com> writes:
>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.
>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.
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.
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]+$
--
Dave Wolfe | 6501 William Cannon Dr. W. | (512) 891-3246
Motorola SPS | Austin, TX 78735-8598 | dwolfe@pets.sps.mot.com
Re: How to kill subject with only Capitals & Punctuation?
Author: H. Vaisanen
Date: Thu, 17 Feb 1994 08:17
Date: Thu, 17 Feb 1994 08:17
7 lines
1008 bytes
1008 bytes
Nancy McGough <nancym@ii.com> writes: >how to catch subjects like the above that are in all caps and also >contain punctuation like " and !? FYI, nn uses egrep-type regexps. :/=!s:^[A-Z .,?:0-9=;|/*!@~#$%^&*()_+\]*$ Add punctuation if necessary. (-:
Re: How to kill subject with only Capitals & Punctuation?
Author: Nancy McGough
Date: Fri, 18 Feb 1994 00:47
Date: Fri, 18 Feb 1994 00:47
50 lines
2712 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads