🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
7 messages
7 total messages Started by Darrien Fri, 25 Jul 2003 14:36
[Xnews] regex assistance needed
#129440
Author: Darrien
Date: Fri, 25 Jul 2003 14:36
17 lines
1765 bytes
I'd like to do two things in Xnews. 

First, I'd like to kill all articles and their replies where the subject line 
contains all caps. I currently have "~Subject= .*[a-z]" in my score file.
I've tried modifying it to something like "~Subject= .*(re)?[a-z]" and 
variants, but have had no luck.

Secondly, I'd like to kill all articles that come from X days in the future.
Can this be done with a regex? If not, is there a setting I have overlooked?


-- 
Some people hate Blacks,
Some people hate Jews
Some people hate Republicans,
but I hate the GNU!
Re: [Xnews] regex assistance needed
#129441
Author: Sepp
Date: Fri, 25 Jul 2003 15:27
25 lines
1660 bytes
Darrien <Darrien_Lambert@NA._.COM@hotmail.com> wrote in
news:Xns93C34E26ED97CDarrienL@140.99.99.130: 
    	
[a-z0-9\W]*

but I think you will find that subjects in all caps also have 
special characters

It is that which is more difficult to filter out...

sepp
> I'd like to do two things in Xnews. 
> 
> First, I'd like to kill all articles and their replies where the
> subject line contains all caps. I currently have "~Subject= .*[a-z]"
> in my score file. I've tried modifying it to something like "~Subject=
> .*(re)?[a-z]" and variants, but have had no luck.
> 
> Secondly, I'd like to kill all articles that come from X days in the
> future. Can this be done with a regex? If not, is there a setting I
> have overlooked? 
> 
> 

Re: [Xnews] regex assistance needed
#129452
Author: Sepp
Date: Fri, 25 Jul 2003 18:10
45 lines
2137 bytes
Sepp <seppludwig@isuisse.com> wrote in 
news:Xns93C3B1749D6E8Sepp@130.133.1.4:
this works:

(?-i)[a-z]

this will give you all subjects which are NOT all capitals.

press "i" to get the inverse, that is, the articles which ARE only
 capitals.

I don't know if it is just my setup, but it seems that xnews  
defaults to "ignore upper or lowercase", which normally is switched
on by (?i).

Hence I have switched it off with (?-i) and eureka, it worked!


> Darrien <Darrien_Lambert@NA._.COM@hotmail.com> wrote in
> news:Xns93C34E26ED97CDarrienL@140.99.99.130: 
>          
> [a-z0-9\W]*
> 
> but I think you will find that subjects in all caps also have 
> special characters
> 
> It is that which is more difficult to filter out...
> 
> sepp
>> I'd like to do two things in Xnews. 
>> 
>> First, I'd like to kill all articles and their replies where the
>> subject line contains all caps. I currently have "~Subject= .*[a-z]"
>> in my score file. I've tried modifying it to something like "~Subject=
>> .*(re)?[a-z]" and variants, but have had no luck.
>> 
>> Secondly, I'd like to kill all articles that come from X days in the
>> future. Can this be done with a regex? If not, is there a setting I
>> have overlooked? 
>> 
>> 
> 
> 

Re: [Xnews] regex assistance needed
#129456
Author: Murray Peterson
Date: Fri, 25 Jul 2003 18:37
29 lines
2151 bytes
Darrien <Darrien_Lambert@NA._.COM@hotmail.com> wrote in
news:Xns93C34E26ED97CDarrienL@140.99.99.130: 

> I'd like to do two things in Xnews. 
> 
> First, I'd like to kill all articles and their replies where the
> subject line contains all caps. I currently have "~Subject= .*[a-z]"
> in my score file. I've tried modifying it to something like "~Subject=
> .*(re)?[a-z]" and variants, but have had no luck.

The ".*" in your expression will render it useless.  .*[a-z]* will match 
absolutely any line (0 or more of any character followed by 0 or more of a 
through z).  Try this instead:
        	~Subject: [a-z]
Kills any subject that does NOT contain any of the letters a through z.
I'll let you figure out variations that might be of more use to you.

> Secondly, I'd like to kill all articles that come from X days in the
> future. Can this be done with a regex? If not, is there a setting I
> have overlooked? 

Regular expressions do not have facilities for date conversions and 
comparisons.

-- 
Murray Peterson
Email: murray_peterson@shaw.ca (remove underscore)
URL:   http://members.shaw.ca/murraypeterson/
Re: [Xnews] regex assistance needed
#129457
Author: Murray Peterson
Date: Fri, 25 Jul 2003 18:39
30 lines
2001 bytes
Sepp <seppludwig@isuisse.com> wrote in 
news:Xns93C3CCF5222E3Sepp@130.133.1.4:

> Sepp <seppludwig@isuisse.com> wrote in 
> news:Xns93C3B1749D6E8Sepp@130.133.1.4:
> this works:
> 
> (?-i)[a-z]
> 
> this will give you all subjects which are NOT all capitals.
> 
> press "i" to get the inverse, that is, the articles which ARE only
>  capitals.
> 
> I don't know if it is just my setup, but it seems that xnews  
> defaults to "ignore upper or lowercase", which normally is switched
> on by (?i).
> 
> Hence I have switched it off with (?-i) and eureka, it worked!

Comparisons are case insensitive by default, but this does not apply to 
items inside a character class.  e.g. [A-Z] will only match upper case 
letters, without the need for the ?-i switch.


-- 
Murray Peterson
Email: murray_peterson@shaw.ca (remove underscore)
URL:   http://members.shaw.ca/murraypeterson/
Re: [Xnews] regex assistance needed
#129459
Author: Alan Ford
Date: Fri, 25 Jul 2003 19:02
26 lines
1979 bytes
At /25 lug 2003/, *Darrien* wrote:

> First, I'd like to kill all articles and their replies where the
> subject line contains all caps. I currently have "~Subject=
> .*[a-z]" in my score file. I've tried modifying it to something
> like "~Subject= .*(re)?[a-z]" and variants, but have had no luck.

    Score: -9999
    ~Subject= .*[a-z0-9]

    Score: -9999
    Subject= ^[Rr][Ee]: [^a-z0-9]*$
    Subject= ^[Rr][Ee]: .*[A-Z]

> Secondly, I'd like to kill all articles that come from X days in
> the future. Can this be done with a regex? If not, is there a
> setting I have overlooked? 

No :o(

Bye.

-- 
 /   _ _ | Xnews in italiano e Guida ai Menu
( (/( (/ | http://digilander.libero.it/xnews
Re: [Xnews] regex assistance needed
#129463
Author: Tech Zero
Date: Fri, 25 Jul 2003 20:01
34 lines
2217 bytes
The voice of "Darrien" drifted in on the cyber-winds, 
from the sea of virtual chaos...

> I'd like to do two things in Xnews. 
> 
> First, I'd like to kill all articles and their replies where the
> subject line contains all caps. I currently have "~Subject=
> .*[a-z]" in my score file. I've tried modifying it to something
> like "~Subject= .*(re)?[a-z]" and variants, but have had no luck.

It's the "e" in "Re" that's the hitch. Since its quite unlikely that 
someone would post a message consisting only the Capital letter "E" I 
just remove it from test. This eliminates the need for further 
exceptions...

    Score: -9999
	~Subject= [a-df-z]

Small, simple, and elegant...

> Secondly, I'd like to kill all articles that come from X days in
> the future. Can this be done with a regex? If not, is there a
> setting I have overlooked? 

Unfortunately time isn't score-able... There is no way to create an 
expression to test on the Date/Time headers using Regex.

-- 
The Reverend Tech Zero (AKA: Maxwell Pollare)
First Baptist Church of X-News, may Delphi v7 save your soul...

* http://www.slyck.com/xnews.html  http://www.seegras.de/xnews     *
* http://www.geocities.com/d4vidb/ http://xnews.newsguy.com/sizer/ *
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