Discussion:
[slrn] scoring
(too old to reply)
Lewis
2020-05-16 13:35:30 UTC
Permalink
I am trying to match for a specific string followed by a space in the
From header

Let's say, the name ATTENTION.

I want to match

"From: ATTENTION " followed by anything else

I do not want to match any of the following:
"From: Joe ATTENTION "
"From: ATTENTION-DEFICIT "
"From: Mr ATTENTION "

I have tried

From:[ ]ATTENTION[ ]
From:\ ATTENTION\
From: ATTENTION[ ]
From: \<ATTENTION\>

none match. (placed as first entries in the score file)

According to <http://www.jedsoft.org/slang/doc/html/slang-22.html>

[ ... ] matches any single character between brackets.
\< Match the beginning of a word.
\> Match the end of a word.

Also, I don't see how to specify a position in the From header for the
"Mr ATTENTION" example above.
--
"Are you pondering what I'm pondering?"
"I think so, Brain, but wouldn't his movies be more suitable for
children if he was named Jean-Claude van Darn?"
Marcel Logen
2020-05-16 16:17:27 UTC
Permalink
Post by Lewis
I am trying to match for a specific string followed by a space in the
From header
Let's say, the name ATTENTION.
I want to match
"From: ATTENTION " followed by anything else
What about

From: ATTENTION .*

or

From: ^ATTENTION .*$

?

<http://slrn.sourceforge.net/docs/score.html> says:

| A keyword line begins with the name of the keyword
| followed immediately by one or two colons and one space.
| The rest of the line usually consists of a regular
| expression.

Marcel
--
╭─╮ ╭───╮ ╭────────╮ ╭──╮ ╭─────────╮ ╭────╮ ╭────────
╭─╯ ╰─╯ │ ╰─────╮ │ ╭──╮ │ ╰─╯ │ ╰──╮ ╰─╮ ╰────╮
╯ │ ╭─╮ ╭──╯ │ │ │ │ │ ╭─╮ ╰─╮ │ ╭────╯
╰──╯ ╰──╯ ╰──╯ ╰───╯ ╰─╯ ╰────╯ ╰──╯
Lewis
2020-05-16 18:19:21 UTC
Permalink
Post by Lewis
I am trying to match for a specific string followed by a space in the
From header
Let's say, the name ATTENTION.
I want to match
"From: ATTENTION " followed by anything else
"From: Joe ATTENTION "
"From: ATTENTION-DEFICIT "
"From: Mr ATTENTION "
I have tried
From:[ ]ATTENTION[ ]
From:\ ATTENTION\
From: ATTENTION[ ]
From: \<ATTENTION\>
Well, that was dump.

In testing I had various patterns in an OR match. Or so I thought.

{:
pattern
pattern
pattern
}

instead of {::
--
This above all, to thine own self be true And it must follow, as the
night the day, Thou canst not then be false to any man.
Loading...