[Update] Xnews v??.01.30

  • Thread starter Thread starter ArjanDotOrg
  • Start date Start date
How in Xnews do I, for example:

Hilight if 'from' contains "»Q«" in alt.comp.freeware.* [using
assigned color] - All posts by »Q« in this heirarchy are given a
color and are hilighted (flagged, I guess). Or is this done in
scoring with Xnews?

Yeah, all your examples are jobs for scoring in Xnews.

Probably safer to use my message IDs than my from header, unless
you want to play with the MIME encoding.

[^alt\.comp\.freeware]
Score:: =1
Message-ID: itsmeitsQ@

A score of one will make the post blue; higher scores will give
different colors, but I don't have the colors memorized.
Highlight if 'subject' matches the regular expression
"(Blowfish|Blowfish ?Advanced)" in * [using assigned color] - So
all posts with Blowfish or Blowfish Advanced in the Subject are
hilited in all heirarchies. Again; Is this done in scoring, not
filtering with Xnews?

[.]
Score:: +50
Subject: Blowfish

The +50 adds to the post's score rather than assigning it a score
of 50. Any Subject that matches "Blowfish Advanced" will also
match just "Blowfish", so I left that part out.
Kill if 'subject' matches the regular expression "^\[?F ?A.?" to
filter out all those FA posts I'm not interested in?

Killing is done by giving posts a score of -9999. If you're ever
unsure a regex does quite what you want, you can test bye using a
negative score not quite so low.

[.]
Score: -9999
Subject: ^\[?F\s?A

A .? at the end of a regex doesn't add anything. That one needs
some work, as it would kill a Subject such as "Fathers and sons".
Probably ^\[f\s?a\b would do what you want.
Anyway, I guess I'm just not finding Xnews filters easy to
impliment as I did with MTNW, which had easy to use dialogs so
that even comatosed brains like mine could work it out without
having to think too hard about it.

There's a scoring dialog (Article | Add to score file) which will
let you create scoring rules based on a few of the current post's
headers. I only use it for quickly killing or watching threads and
subthreads (the radio buttons at the bottom). For anything else,
I edit the score file directly.

Thanks very much »Q« :)

This clears up a lot for me. Not to mention a good starting point into
Filters vs Scoring in Xnews. Frankly, I've been put off looking deeper
into the issue of Xnews score files and how they work. but your post
has helped a lot to allay my fears.

Ah goody. I see someone has made several posts to a.c.f this afternoon
and warrents a little scoring :)

Cheers
 
Thanks very much »Q« :)

This clears up a lot for me. Not to mention a good starting point
into Filters vs Scoring in Xnews. Frankly, I've been put off
looking deeper into the issue of Xnews score files and how they
work. but your post has helped a lot to allay my fears.

Glad to be of some help. :)

There are a couple of example score files on the web, linked from my
page <http://www.cotse.net/users/putty/score>. The other links are
just back to the documentation that comes with Xnews and to The Regex
Coach (freeware I highly recommend).
 
Barney said:
Mike Dee <[email protected]> had
written



A lot of changes and presumably I got the newest now. No matter how I
try, I can't get on the newsguys site. I got the page you have given me
but when I remove the "test/change.text" part, the same message. I will
give MIE a crack at it. Maybe FF is getting corrupt. It worked when I
downloaded the latest test yesterday!
Why use XNEWS?
Change to BNR2 for a "newsreader"..
 
Why use XNEWS?
Change to BNR2 for a "newsreader"..

Any particular reason you'd like to mention?

Also, any reason you are using Thunderbird instead of BNR2 for a
"newsreader"?
 
Glad to be of some help. :)

There are a couple of example score files on the web, linked from my
page <http://www.cotse.net/users/putty/score>. The other links are
just back to the documentation that comes with Xnews and to The Regex
Coach (freeware I highly recommend).

Nice web page BTW. Nice clear legible print. Have downloaded The Regex
Coach, and have gone back to RTFM. Now that I know what to look for
it's becoming much clearer and easier to play around with.

Thanks again.
 
Mike Dee said:
Kill if 'subject' matches the regular expression "^\[?F ?A.?" to
filter out all those FA posts I'm not interested in?

Killing is done by giving posts a score of -9999. If you're ever
unsure a regex does quite what you want, you can test bye using a
negative score not quite so low.

[.]
Score: -9999
Subject: ^\[?F\s?A

A .? at the end of a regex doesn't add anything. That one needs
some work, as it would kill a Subject such as "Fathers and sons".
Probably ^\[f\s?a\b would do what you want.

Major discovery for me :)

The reg ex strings I've been using in MT-NewsWatcher filters seem to be
usable in Xnews scoring. Based on above:
[.]
Score: -9999
Subject: ^\[?F.?A.?

This kills 'For Auction' articles which I'm not interested in seeing,
and have a subject line that starts with either FA, F.A., [FA] or
[F.A.].

The '?' at the end of the reg ex does add something. It matches zero or
one instance of the preceeding character, so prevents scoring on
articles such as "Fathers and sons".

Cheers
 
A .? at the end of a regex doesn't add anything. That one needs
some work, as it would kill a Subject such as "Fathers and sons".
Probably ^\[f\s?a\b would do what you want.

Major discovery for me :)

Minor discovery for me :(
The reg ex strings I've been using in MT-NewsWatcher filters seem
to be usable in Xnews scoring. Based on above:
[.]
Score: -9999
Subject: ^\[?F.?A.?

This kills 'For Auction' articles which I'm not interested in
seeing, and have a subject line that starts with either FA, F.A.,
[FA] or [F.A.].

The '?' at the end of the reg ex does add something. It matches
zero or one instance of the preceeding character, so prevents
scoring on articles such as "Fathers and sons".


Scratch that. I should learn to test before I post :)
The '?' at the end here appears not to do anything. Will play around a
bit more with it.
 
Mike Dee said:
Kill if 'subject' matches the regular expression "^\[?F
?A.?" to filter out all those FA posts I'm not interested
in?

Killing is done by giving posts a score of -9999. If
you're ever unsure a regex does quite what you want, you
can test bye using a negative score not quite so low.

[.]
Score: -9999
Subject: ^\[?F\s?A

A .? at the end of a regex doesn't add anything. That one
needs some work, as it would kill a Subject such as
"Fathers and sons". Probably ^\[f\s?a\b would do what you
want.

Major discovery for me :)

The reg ex strings I've been using in MT-NewsWatcher
filters seem to be usable in Xnews scoring. Based on above:
[.]
Score: -9999
Subject: ^\[?F.?A.?

This kills 'For Auction' articles which I'm not interested
in seeing, and have a subject line that starts with either
FA, F.A., [FA] or [F.A.].

The '?' at the end of the reg ex does add something. It
matches zero or one instance of the preceeding
character, so prevents scoring on articles such as
"Fathers and sons".

Cheers

FWIW: Do you care about case?
That regex would also match fa, f.a., etc.

J
 
The reg ex strings I've been using in MT-NewsWatcher filters seem to be
usable in Xnews scoring. Based on above:
[.]
Score: -9999
Subject: ^\[?F.?A.?

This kills 'For Auction' articles which I'm not interested in seeing,
and have a subject line that starts with either FA, F.A., [FA] or
[F.A.].

The '?' at the end of the reg ex does add something. It matches zero or
one instance of the preceeding character, so prevents scoring on
articles such as "Fathers and sons".


Shouldnt the periods be escaped eg \[?F\.?A\.?

Else you will match

FRANCE for example ??
 
The reg ex strings I've been using in MT-NewsWatcher filters seem
to be usable in Xnews scoring. Based on above:
[.]
Score: -9999
Subject: ^\[?F.?A.?

This kills 'For Auction' articles which I'm not interested in
seeing, and have a subject line that starts with either FA, F.A.,
[FA] or [F.A.].

The '?' at the end of the reg ex does add something. It matches
zero or one instance of the preceeding character, so prevents
scoring on articles such as "Fathers and sons".


Scratch that. I should learn to test before I post :)
The '?' at the end here appears not to do anything. Will play
around a bit more with it.


I see what you want now (I think) and you are almost there; you want
to match FA and F.A. at the start of the string whether they are
enclosed in brackets or not. In PCRE, the . is a special character
which matches any character.[1] To match a literal dot, you need to
use \. instead.

^\[?f\.?a\.?\b

The final \b matches a "word boundary"; it will match only if the
following character is non-alphanumeric, e.g. a closing bracket or a
whitespace. The \b should prevent matching "fathers and sons".

[1] That's why a .? at the end of a regex doesn't do anything -- it
just matches any character zero or more times, i.e. it matches
anything at all.
 
Nice web page BTW. Nice clear legible print. Have downloaded The
Regex Coach, and have gone back to RTFM. Now that I know what to
look for it's becoming much clearer and easier to play around
with.

Thanks again.

Thanks for the kind words. The Regex Coach is pretty amazing.

I can't take any credit for the print legibility on my pages. Credit
goes to the people who made the Bitstream Vera fonts, which are what
you see if you have them installed. They are great; I made them my
default fonts in Firefox, and checked the "always use my fonts" box, so
all web pages look that way to me.
 
(e-mail address removed) wrote in
[.]
Score: -9999
Subject: ^\[?F.?A.?

This kills 'For Auction' articles which I'm not interested
in seeing, and have a subject line that starts with either
FA, F.A., [FA] or [F.A.].
FWIW: Do you care about case?
That regex would also match fa, f.a., etc.

No I'm not concerned about the case, I know that Xnews scoring is case-
insensitive.

I'm more concerned with it not scoring any characters beyond the A or
possible period after the A, so far I'm not having success with this
expression no matter how I change it, I still get it picking up on any
string beginning with "fa" such as "Fat chance you'll lick this" kind
of thing.

It works to a degree, in that it picks up on "for auction" posts OK but
fails (by scoring) where any title begins with "Fa".
 
Q, could you post the link to your web page again? I never thought
fonts could make
so much of a difference and would like to see them.

Thanks, Mark
 
Mike Dee said:
Scratch that. I should learn to test before I post :)
The '?' at the end here appears not to do anything. Will play
around a bit more with it.

I see what you want now (I think) and you are almost there; you want
to match FA and F.A. at the start of the string whether they are
enclosed in brackets or not. In PCRE, the . is a special character
which matches any character.[1] To match a literal dot, you need to
use \. instead.

^\[?f\.?a\.?\b

Thanks, this give an 'Invalid test expression" error in Xnews.

But...
The final \b matches a "word boundary"; it will match only if the
following character is non-alphanumeric, e.g. a closing bracket or a
whitespace. The \b should prevent matching "fathers and sons".

the \b works <G>

Here goes:

Score:: =3
Subject: ^\[?f[\.]?a[\.]?\b

It may be not quite right, so I'll let it run for a day or two to see
if any quirks show through, then move it to a -9999 score.
[1] That's why a .? at the end of a regex doesn't do anything -- it
just matches any character zero or more times, i.e. it matches
anything at all.

It does in MT-NewsWatcher, which uses PCRE, it's supposed to match a
character, zero or one times only. but with Xnews it does seem to need
the escape \b to prevent it from scoring on the whole string.

Great! Thanks again »Q«
 
Here goes:

Score:: =3
Subject: ^\[?f[\.]?a[\.]?\b

It may be not quite right, so I'll let it run for a day or two to
see if any quirks show through, then move it to a -9999 score.
[1] That's why a .? at the end of a regex doesn't do anything --
it just matches any character zero or more times, i.e. it matches
anything at all.

It does in MT-NewsWatcher, which uses PCRE, it's supposed to match
a character, zero or one times only. but with Xnews it does seem
to need the escape \b to prevent it from scoring on the whole
string.

Interestingly, the Regex Coach passes the expression ^\[?F.?A.? as used
with MT-NW, with flying colors ie; 100% success. Yet the reg ex I'm now
using with Xnews fails totally in Regex Coach.

Just as well it works in Xnews, I guess ;-)
 
^\[?f\.?a\.?\b

Thanks, this give an 'Invalid test expression" error in Xnews.

It works ok in Xnews here, at least in the Xnews regex tester
(Special | test regex).
the \b works <G>

Here goes:

Score:: =3
Subject: ^\[?f[\.]?a[\.]?\b

It may be not quite right, so I'll let it run for a day or two to
see if any quirks show through, then move it to a -9999 score.

That should work ok too. You've just made a character class for
each dot, which is fine.
[1] That's why a .? at the end of a regex doesn't do anything --
it just matches any character zero or more times, i.e. it matches
anything at all.

It does in MT-NewsWatcher, which uses PCRE, it's supposed to match
a character, zero or one times only. but with Xnews it does seem
to need the escape \b to prevent it from scoring on the whole
string.

My bad; you're right, zero or one times only. But the . matches
*any* chararacter, including the t in "fathers". The regex you had
before, ^\[?F.?A.?
1222344566

matches

1 - start of string
2 - possibly followed by a single [
3 - followed by an F
4 - possibly followed by any character
5 - followed by an A
6 - possibly followed by any character

so it would also match "feathers".
3456
 
»Q« said:
[email protected]>:




Any particular reason you'd like to mention?

Also, any reason you are using Thunderbird instead of BNR2 for a
"newsreader"?
Well I use BNR2 because it's stable (for me) and it can poll multiple
news servers.
I use Thunderbird for the "text" newsgroups only.. BNR2 is a newsreader
only, it can't compose replies.
 
^\[?f\.?a\.?\b

Thanks, this give an 'Invalid test expression" error in Xnews.

It works ok in Xnews here, at least in the Xnews regex tester
(Special | test regex).

So it does - *boggles* - so that's what that menu is for ;-)
Thanks again.

I cut-n-pasted this time and it works fine here, something I must've
mushed up before. Tested it also in the Regex Coach. It works there
too, but appears to be Case sensitive. I think Regex Coach is more
strict in it's interpretation of PCRE.
the \b works <G>

Here goes:

Score:: =3
Subject: ^\[?f[\.]?a[\.]?\b

It may be not quite right, so I'll let it run for a day or two to
see if any quirks show through, then move it to a -9999 score.

That should work ok too. You've just made a character class for
each dot, which is fine.

Working fine in Xnews. Regex Coach hates it :)
Actually it's the strict case sensitivity of Regex Coach that's the
problem. Xnews doesn't have that issue to worry about.
[1] That's why a .? at the end of a regex doesn't do anything --
it just matches any character zero or more times, i.e. it matches
anything at all.

It does in MT-NewsWatcher, which uses PCRE, it's supposed to match
a character, zero or one times only. but with Xnews it does seem
to need the escape \b to prevent it from scoring on the whole
string.

My bad; you're right, zero or one times only. But the . matches
*any* chararacter, including the t in "fathers". The regex you had
before, ^\[?F.?A.?
1222344566

matches

1 - start of string
2 - possibly followed by a single [
3 - followed by an F
4 - possibly followed by any character
5 - followed by an A
6 - possibly followed by any character

so it would also match "feathers".
3456

Also was why I enclosed and escaped the [\.], forcing the ? to match
zero or one period. It works a lot better, but I'm leaving that \b in
for good measure. So far so good.
 
Well I use BNR2 because it's stable (for me) and it can poll
multiple news servers.
I use Thunderbird for the "text" newsgroups only.. BNR2 is a
newsreader only, it can't compose replies.

Xnews can poll multiple news servers, is stable and can also post.
 
Tested it also in the Regex Coach. It works there
too, but appears to be Case sensitive. I think Regex Coach is more
strict in it's interpretation of PCRE.

In PCRE there's a toggle for case insensitivity.

In Xnews, it's insensitive by default, and to use case sensitivity, you
must use the switch (?-i) before the regex. (It's kind of a tricky
double negative; -i toggles case insensitivity off, IOW toggles case
sensitivity on.)

In The Regex Coach, there are checkboxes to the right of the GUI for
the PCRE option toggles, and mouse-hovering will show you what each one
does.
 
Back
Top