Thread View: news.software.readers
19 messages
19 total messages
Started by Mike Dee
Fri, 16 Mar 2012 00:26
[Xnews] score file question
Author: Mike Dee
Date: Fri, 16 Mar 2012 00:26
Date: Fri, 16 Mar 2012 00:26
24 lines
2206 bytes
2206 bytes
There is a simple example given in the Xnews "scoring.txt" for scoring against posts without a lower case letter in a subject title > -------- > [.] > Score: -9999 > ~Subject= .*[a-z] > -------- I've been using "~Subject= [a-z]" without the preceding ".*" for some time and there doesn't seem to be any problem with that. I haven't seen any all caps subjects in a long time. My question is why the ".*" in front of [a-z] in the scoring.txt example? Am I missing something or haven't there been any full cap subjects posted in the last 2 or 3 years? - Maybe just not to the groups I visit ;-) Not trying to shave off a zillionth of a nano second running this score rule, only it doesn't seem to serve any real purpose to me (the ".*" part of it). -- dee
Re: [Xnews] score file question
Author: Gene E. Bloch
Date: Fri, 16 Mar 2012 00:57
Date: Fri, 16 Mar 2012 00:57
30 lines
2029 bytes
2029 bytes
On 3/15/2012, Mike Dee posted: > There is a simple example given in the Xnews "scoring.txt" for > scoring against posts without a lower case letter in a subject title >> -------- >> [.] >> Score: -9999 >> ~Subject= .*[a-z] >> -------- > I've been using "~Subject= [a-z]" without the preceding ".*" for > some time and there doesn't seem to be any problem with that. I > haven't seen any all caps subjects in a long time. > My question is why the ".*" in front of [a-z] in the scoring.txt > example? Am I missing something or haven't there been any full cap > subjects posted in the last 2 or 3 years? - Maybe just not to the > groups I visit ;-) > Not trying to shave off a zillionth of a nano second running this > score rule, only it doesn't seem to serve any real purpose to me > (the ".*" part of it). How does your filter respond if the first, or maybe I mean the only, character of the subject is lower case? -- Gene E. Bloch (Stumbling Bloch)
Re: [Xnews] score file question
Author: John Wunderlich
Date: Fri, 16 Mar 2012 05:08
Date: Fri, 16 Mar 2012 05:08
40 lines
2567 bytes
2567 bytes
Mike Dee <mikedee@emteedee.invalid> wrote in news:XnsA01888C1FC5Amikedee@emteedee.invalid: > There is a simple example given in the Xnews "scoring.txt" for > scoring against posts without a lower case letter in a subject title > >> -------- >> [.] >> Score: -9999 >> ~Subject= .*[a-z] >> -------- > > I've been using "~Subject= [a-z]" without the preceding ".*" for > some time and there doesn't seem to be any problem with that. I > haven't seen any all caps subjects in a long time. > > My question is why the ".*" in front of [a-z] in the scoring.txt > example? Am I missing something or haven't there been any full cap > subjects posted in the last 2 or 3 years? - Maybe just not to the > groups I visit ;-) > > Not trying to shave off a zillionth of a nano second running this > score rule, only it doesn't seem to serve any real purpose to me > (the ".*" part of it). > You're right. In Xnews, the two expressions are functionally exactly equivalent. Being that Xnews will search for the given expression anywhere within the [Subject], your expression of "[a-z]" will match any subject containing a lower case letter. The expression ".*[a- z]" will match any [Subject] containing a lower case letter preceeded by zero or more characters -- which is exactly the same. Of course the ~ in front of "Subject" negates the result and the "=" makes the expression case sensitive. HTH, JW
Re: [Xnews] score file question
Author: Mike Dee
Date: Fri, 16 Mar 2012 11:01
Date: Fri, 16 Mar 2012 11:01
16 lines
1995 bytes
1995 bytes
Gene E. Bloch wrote: > How does your filter respond if the first, or maybe I mean the only, > character of the subject is lower case? If the subject was, for example: HELP!!!! MY KEYBOARD KEePS JAMMING INTERMITTEDLY IN uPPEr CASE!!!!! The filter would trigger on the 1st lower case letter (the "e" in "KEePS" in the above example) - It wouldn't seek past that point because its test is to find one lower case letter (and not kill it if it finds one). -- dee
Re: [Xnews] score file question
Author: Mike Dee
Date: Fri, 16 Mar 2012 11:11
Date: Fri, 16 Mar 2012 11:11
26 lines
2438 bytes
2438 bytes
John Wunderlich wrote: > You're right. In Xnews, the two expressions are functionally > exactly equivalent. Being that Xnews will search for the given > expression anywhere within the [Subject], your expression of > "[a-z]" will match any subject containing a lower case letter. > The expression ".*[a- z]" will match any [Subject] containing a > lower case letter preceeded by zero or more characters -- which is > exactly the same. Thanks John. I think Luu Tran may have "lifted" this one directly from the slrn PCRE example pages without a second thought. I was just curious as to why the need for the ".*" here, it seems to be superfluous. > Of course the ~ in front of "Subject" negates > the result and the "=" makes the expression case sensitive. That much I knew - and use ;-) To take a leaf out of Mike Yetto's book (to rip him off IOW): Mike "Its all slrn's fault" Dee -- dee
Re: [Xnews] score file question
Author: »Q«
Date: Fri, 16 Mar 2012 18:39
Date: Fri, 16 Mar 2012 18:39
20 lines
2150 bytes
2150 bytes
On Fri, 16 Mar 2012 11:11:40 +0000 (UTC) Mike Dee <mikedee@emteedee.invalid> wrote: > John Wunderlich wrote: > > > You're right. In Xnews, the two expressions are functionally > > exactly equivalent. Being that Xnews will search for the given > > expression anywhere within the [Subject], your expression of > > "[a-z]" will match any subject containing a lower case letter. > > The expression ".*[a- z]" will match any [Subject] containing a > > lower case letter preceeded by zero or more characters -- which is > > exactly the same. > > Thanks John. I think Luu Tran may have "lifted" this one directly > from the slrn PCRE example pages without a second thought. I was just > curious as to why the need for the ".*" here, it seems to be > superfluous. Not slrn PCRE example pages. AFAIK slrn still uses slang regexen, and I'm sure it did when Luu gave us the Holy Documentation.
Re: [Xnews] score file question
Author: Mike Dee
Date: Fri, 16 Mar 2012 19:22
Date: Fri, 16 Mar 2012 19:22
18 lines
2157 bytes
2157 bytes
=?UTF-8?B?wrtRwqs=?= wrote: > Mike Dee <mikedee@emteedee.invalid> wrote: > >> I think Luu Tran may have "lifted" this one directly >> from the slrn PCRE example pages without a second thought. I was >> just curious as to why the need for the ".*" here, it seems to be >> superfluous. > > Not slrn PCRE example pages. AFAIK slrn still uses slang regexen, > and I'm sure it did when Luu gave us the Holy Documentation. You are right. I was shooting from the lip WRT slrn :-[ I take a size 10 in concrete shoes. -- dee
Re: [Xnews] score file question
Author: Gene E. Bloch
Date: Fri, 16 Mar 2012 22:16
Date: Fri, 16 Mar 2012 22:16
32 lines
2094 bytes
2094 bytes
On 3/16/2012, Mike Dee posted: > Gene E. Bloch wrote: >> How does your filter respond if the first, or maybe I mean the only, >> character of the subject is lower case? > If the subject was, for example: > HELP!!!! MY KEYBOARD KEePS JAMMING INTERMITTEDLY IN uPPEr CASE!!!!! > The filter would trigger on the 1st lower case letter (the "e" in > "KEePS" in the above example) - It wouldn't seek past that point > because its test is to find one lower case letter (and not kill it if > it finds one). OK. I'm rusty on REs in general, and I haven't tried it in Xnews for a very long time, so I was wondering if your RE would respond only to a post whose subject is a single lower case character. I don't have Xnews installed to try it for myself. As a reminder, your RE was this: "~Subject= [a-z]" which seems to me to say "any Subject which is not a single character consisting of one of the letters a-z". -- Gene E. Bloch (Stumbling Bloch)
Re: [Xnews] score file question
Author: Gene E. Bloch
Date: Fri, 16 Mar 2012 22:32
Date: Fri, 16 Mar 2012 22:32
38 lines
2412 bytes
2412 bytes
On 3/16/2012, Gene E. Bloch posted: > On 3/16/2012, Mike Dee posted: >> Gene E. Bloch wrote: >>> How does your filter respond if the first, or maybe I mean the only, >>> character of the subject is lower case? >> If the subject was, for example: >> HELP!!!! MY KEYBOARD KEePS JAMMING INTERMITTEDLY IN uPPEr CASE!!!!! >> The filter would trigger on the 1st lower case letter (the "e" in "KEePS" >> in the above example) - It wouldn't seek past that point because its test >> is to find one lower case letter (and not kill it if it finds one). > OK. > I'm rusty on REs in general, and I haven't tried it in Xnews for a very long > time, so I was wondering if your RE would respond only to a post whose > subject is a single lower case character. I don't have Xnews installed to try > it for myself. > As a reminder, your RE was this: > "~Subject= [a-z]" > which seems to me to say "any Subject which is not a single character > consisting of one of the letters a-z". I should have said "seems ... to say" in the past tense, i.e., s/seems/seemed/ Between what your wrote above and other posts in this thread, I can only say that "I'm rusty on REs" is overly optimistic on my part. -- Gene E. Bloch (Stumbling Bloch)
Re: [Xnews] score file question
Author: Mike Dee
Date: Sat, 17 Mar 2012 01:10
Date: Sat, 17 Mar 2012 01:10
77 lines
4468 bytes
4468 bytes
Gene E. Bloch wrote: > On 3/16/2012, Gene E. Bloch posted: >> On 3/16/2012, Mike Dee posted: >>> Gene E. Bloch wrote: > >>>> How does your filter respond if the first, or maybe I mean the >>>> only, character of the subject is lower case? > >>> If the subject was, for example: > >>> HELP!!!! MY KEYBOARD KEePS JAMMING INTERMITTEDLY IN uPPEr >>> CASE!!!!! > >>> The filter would trigger on the 1st lower case letter (the "e" >>> in "KEePS" in the above example) - It wouldn't seek past that >>> point because its test is to find one lower case letter (and not >>> kill it if it finds one). > >> OK. > >> I'm rusty on REs in general, and I haven't tried it in Xnews for >> a very long time, so I was wondering if your RE would respond >> only to a post whose subject is a single lower case character. I >> don't have Xnews installed to try it for myself. > >> As a reminder, your RE was this: >> "~Subject= [a-z]" > >> which seems to me to say "any Subject which is not a single >> character consisting of one of the letters a-z". > > I should have said "seems ... to say" in the past tense, i.e., > s/seems/seemed/ > > Between what your wrote above and other posts in this thread, I > can only say that "I'm rusty on REs" is overly optimistic on my > part. I'm more than a little rusty. But, yes, the score rule will pick up on a single lower case character (the 1st one it finds) and stop running at that point as it has then "done its job". The example in the Xnews scoring.txt file is "~Subject= .*[a-z]" If that runs over the Subject string: HELP!!!! MY KEYBOARD KEePS JAMMING INTERMITTEDLY IN uPPEr CASE!!!!! It would return: "HELP!!!! MY KEYBOARD KEePS JAMMING INTERMITTEDLY IN uPPEr" Before the regex ran its course and stopped running. If instead you use the score rule "~Subject= [a-z]" on the same string, it would stop running upon locating the 1st lower case character, and in this example it would return "e" because it only needs to find a single lower-case character. If the Subject was an unlikely but possible single "a" for example, both "~Subject= .*[a-z]" & "~Subject= [a-z]" would get exactly the same result, and trigger on that single lower case "a". By using "~Subject= .*[a-z]", it seeks out all of the lower case characters in a string and doesn't stop until it locates the last lower-case character in that string (and includes all of the other characters before and inbetween). If there was a single lower-case character in that string it would trigger and stop running at that point. Which is what "~Subject= [a-z]" does anyway, without needing to locate other lower case characters nor does it have to look for and return the results of ".*" while doing so. So to me, "~Subject= .*[a-z]" has become redundant. I now prefer to use "~Subject= [a-z]". -- dee
Re: [Xnews] score file question
Author: Mike Yetto
Date: Sat, 17 Mar 2012 15:24
Date: Sat, 17 Mar 2012 15:24
48 lines
3405 bytes
3405 bytes
Gene E Bloch <blochxxxx@someplace.invalid> writes and having writ moves on. >On 3/16/2012, Mike Dee posted: >> Gene E. Bloch wrote: >>> How does your filter respond if the first, or maybe I mean the only, >>> character of the subject is lower case? >> If the subject was, for example: >> HELP!!!! MY KEYBOARD KEePS JAMMING INTERMITTEDLY IN uPPEr CASE!!!!! >> The filter would trigger on the 1st lower case letter (the "e" in >> "KEePS" in the above example) - It wouldn't seek past that point >> because its test is to find one lower case letter (and not kill it if >> it finds one). >OK. >I'm rusty on REs in general, and I haven't tried it in Xnews for a very >long time, so I was wondering if your RE would respond only to a post >whose subject is a single lower case character. I don't have Xnews >installed to try it for myself. >As a reminder, your RE was this: >"~Subject= [a-z]" >which seems to me to say "any Subject which is not a single character >consisting of one of the letters a-z". With "~Subject= [a-z]" the subject can contain a single lowercase character anywhere. To check that it is only a single lowercase character use "~Subject= ^[a-z]*$" and for nothing but lowercase characters use "Subject= ^[A-Z]*$". The second example requires the Subject to start and end with a string of single lowercase characters in order to fail the test and the third requires that the subject is only uppercase characters to pass the test. The "^" indicates the start and the "$" indicates the end of the string to be tested. The first and third are close if you disregard numbers and punctuation. Whichever way you go, you can always test the regex without leaving Xnews. Mike "regex can be even more confusing if you try" Yetto -- In theory, theory and practice are the same. In practice they are not.
Re: [Xnews] score file question
Author: Gene E. Bloch
Date: Sat, 17 Mar 2012 19:07
Date: Sat, 17 Mar 2012 19:07
30 lines
2208 bytes
2208 bytes
On 3/16/2012, Mike Dee posted: >>> As a reminder, your RE was this: >>> "~Subject= [a-z]" >> >>> which seems to me to say "any Subject which is not a single >>> character consisting of one of the letters a-z". >> >> I should have said "seems ... to say" in the past tense, i.e., >> s/seems/seemed/ >> >> Between what your wrote above and other posts in this thread, I >> can only say that "I'm rusty on REs" is overly optimistic on my >> part. > I'm more than a little rusty. > But, yes, the score rule will pick up on a single lower case > character (the 1st one it finds) and stop running at that point as > it has then "done its job". What I thought was that the RE would choose a post consisting only of a single character, rather than containing the single character. That might actually be true of the REs in Unix in the 80s or 90s, when I had an idea what I was doing. Or maybe I'm wrong even there :-) -- Gene E. Bloch (Stumbling Bloch)
Re: [Xnews] score file question
Author: Mike Dee
Date: Sat, 17 Mar 2012 20:13
Date: Sat, 17 Mar 2012 20:13
9 lines
1831 bytes
1831 bytes
Mike Yetto wrote: > Whichever way you go, you can always test the regex > without leaving Xnews. Yep, the built-in regex tester is a handy feature. -- dee
Re: [Xnews] score file question
Author: Gene E. Bloch
Date: Sat, 17 Mar 2012 20:30
Date: Sat, 17 Mar 2012 20:30
20 lines
1836 bytes
1836 bytes
On 3/17/2012, Mike Dee posted: > Mike Yetto wrote: >> Whichever way you go, you can always test the regex >> without leaving Xnews. > Yep, the built-in regex tester is a handy feature. Only works for those who are running Xnews. I think I might even have used it back when I was using Xnews, but no guarantees. The nice thing about Windows is you don't have to know anything about regular expressions to be a Windows user. That is meant as a joke, even if it's not funny. And even if it's true. -- Gene E. Bloch (Stumbling Bloch)
Re: [Xnews] score file question
Author: »Q«
Date: Sat, 17 Mar 2012 21:58
Date: Sat, 17 Mar 2012 21:58
40 lines
2732 bytes
2732 bytes
On Sat, 17 Mar 2012 12:07:12 -0700 Gene E. Bloch <blochxxxx@someplace.invalid> wrote: > On 3/16/2012, Mike Dee posted: > >>> As a reminder, your RE was this: > >>> "~Subject= [a-z]" > >> > >>> which seems to me to say "any Subject which is not a single > >>> character consisting of one of the letters a-z". > >> > >> I should have said "seems ... to say" in the past tense, i.e., > >> s/seems/seemed/ > >> > >> Between what your wrote above and other posts in this thread, I > >> can only say that "I'm rusty on REs" is overly optimistic on my > >> part. > > > I'm more than a little rusty. > > > But, yes, the score rule will pick up on a single lower case > > character (the 1st one it finds) and stop running at that point as > > it has then "done its job". > > What I thought was that the RE would choose a post consisting only of > a single character, rather than containing the single character. > > That might actually be true of the REs in Unix in the 80s or 90s, > when I had an idea what I was doing. Or maybe I'm wrong even there :-) Xnews will check every substring of the Subject against the regex, and if any substring matches, the rule matches. (Well, with ~Subject, the rule matches if *no* substring of the Subject matches the regex.) To make Xnews match only the whole string, ^ and $ are needed, e.g. ^[a-z]$ to match a Subject consisting of one lower case letter and nothing else.
Re: [Xnews] score file question
Author: Mike Dee
Date: Sat, 17 Mar 2012 23:02
Date: Sat, 17 Mar 2012 23:02
31 lines
2755 bytes
2755 bytes
Gene E. Bloch wrote: > On 3/17/2012, Mike Dee posted: >> Mike Yetto wrote: > >>> Whichever way you go, you can always test the regex >>> without leaving Xnews. > >> Yep, the built-in regex tester is a handy feature. > > Only works for those who are running Xnews. I think I might even > have used it back when I was using Xnews, but no guarantees. Its just another fine example in a long list of how Xnews is superior to lesser mere newsreaders ;-) <---- emoticon alert. I've come across built-in regex testers in other nr's but can't recall off-hand which ones. Dialog? Gravity? The Lucy nr apparently does, but I haven't used that reader (http://www.geniegate.com/other/lucy/ This will likely appeal to some here.). > The nice thing about Windows is you don't have to know anything > about regular expressions to be a Windows user. > > That is meant as a joke, even if it's not funny. And even if it's > true. Explaining that it was a joke was funny :-) -- dee
Re: [Xnews] score file question
Author: Mike Yetto
Date: Sun, 18 Mar 2012 14:01
Date: Sun, 18 Mar 2012 14:01
17 lines
2305 bytes
2305 bytes
Mike Dee <mikedee@emteedee.invalid> writes and having writ moves on. >Gene E. Bloch wrote: >> The nice thing about Windows is you don't have to know anything >> about regular expressions to be a Windows user. >> >> That is meant as a joke, even if it's not funny. And even if it's >> true. >Explaining that it was a joke was funny :-) Even if it's true. Mike "we (TINW) just can't help ourselves" Yetto -- In theory, theory and practice are the same. In practice they are not.
Re: [Xnews] score file question
Author: Gene E. Bloch
Date: Sun, 18 Mar 2012 22:40
Date: Sun, 18 Mar 2012 22:40
49 lines
3072 bytes
3072 bytes
On 3/17/2012, »Q« posted: > On Sat, 17 Mar 2012 12:07:12 -0700 > Gene E. Bloch <blochxxxx@someplace.invalid> wrote: >> On 3/16/2012, Mike Dee posted: >>>>> As a reminder, your RE was this: >>>>> "~Subject= [a-z]" >>>> >>>>> which seems to me to say "any Subject which is not a single >>>>> character consisting of one of the letters a-z". >>>> >>>> I should have said "seems ... to say" in the past tense, i.e., >>>> s/seems/seemed/ >>>> >>>> Between what your wrote above and other posts in this thread, I >>>> can only say that "I'm rusty on REs" is overly optimistic on my >>>> part. >> >>> I'm more than a little rusty. >> >>> But, yes, the score rule will pick up on a single lower case >>> character (the 1st one it finds) and stop running at that point as >>> it has then "done its job". >> >> What I thought was that the RE would choose a post consisting only of >> a single character, rather than containing the single character. >> >> That might actually be true of the REs in Unix in the 80s or 90s, >> when I had an idea what I was doing. Or maybe I'm wrong even there :-) > Xnews will check every substring of the Subject against the regex, and > if any substring matches, the rule matches. (Well, with ~Subject, the > rule matches if *no* substring of the Subject matches the regex.) > To make Xnews match only the whole string, ^ and $ are needed, e.g. > ^[a-z]$ to match a Subject consisting of one lower case letter and > nothing else. Which is why I said "what I thought" - but I should have said "what I had thought" for better grammatical clarity. What it is, is that I am learning something in this subthread :-) Which I will try to remember :-) -- Gene E. Bloch (Stumbling Bloch)
Re: [Xnews] score file question
Author: Gene E. Bloch
Date: Sun, 18 Mar 2012 22:42
Date: Sun, 18 Mar 2012 22:42
24 lines
2022 bytes
2022 bytes
On 3/18/2012, Mike Yetto posted: > Mike Dee <mikedee@emteedee.invalid> writes and having writ moves on. >> Gene E. Bloch wrote: >>> The nice thing about Windows is you don't have to know anything >>> about regular expressions to be a Windows user. >>> >>> That is meant as a joke, even if it's not funny. And even if it's >>> true. >> Explaining that it was a joke was funny :-) > Even if it's true. > Mike "we (TINW) just can't help ourselves" Yetto This part of the thread has given me a few good laughs. Gene "needs a few good laughs after showing his ignorance" Bloch -- Gene E. Bloch (Stumbling Bloch)
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