[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Understanding score syntax
From: |
David Z Maze |
Subject: |
Re: Understanding score syntax |
Date: |
Mon, 12 Dec 2005 12:19:58 -0500 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (usg-unix-v) |
currentlyeddie@rogers.com writes:
> From the manual:
>
> ("xref"
> ("[^:\n]+:[0-9]+ +[^:\n]+:[0-9]+ +[^:\n]+:[0-9]+"
> -1000 nil r)))
>
> What, exactly is going on here? I'm especially fuzzy on the 0-9 bits. I
> put this in all.SCORE, and it began lowering scores on messages posted
> to a favorite newsgroup that don't seem to be crossposted.
It's fundamentally a regular expression, and regexps are used in lots
of parts of Emacs and Un*x in general (and perl and python and sed and
...), so they're definitely useful to lear about. Dissecting it:
[^:\n]+ At least one of any character except colon or newline
: A colon
[0-9]+ At least one digit
+ At least one space
[^:\n]+:[0-9]+ + Similarly
[^:\n]+:[0-9]+ Similarly
So it matches headers with values like
gnu.emacs.gnus:1234 alt.fan.lars-magne-ingebrigtsen:567 comp.editors.xemacs:17
That is, with at least three clauses in the Xref: header.
--dzm