Thread View: news.software.readers
13 messages
13 total messages
Started by VanguardLH
Fri, 11 Apr 2008 07:37
40tude Dialog (regex query): How to test for no vowels in Subject?
Author: VanguardLH
Date: Fri, 11 Apr 2008 07:37
Date: Fri, 11 Apr 2008 07:37
48 lines
3055 bytes
3055 bytes
Trying to figure out in 40tude Dialog how to define a scoring filter
that will behave like a rule defined in Outlook Express. In OE, the
rule is:
Apply this rule after the message arrives
Where the Subject line does not contain 'a' or 'e' or 'i' or 'o' or 'u'
Delete it
and Stop processing more rules
So if the Subject doesn't have one, or more, vowels then the post gets
deleted. For Dialog in a scoring rule, I first thought of:
!delete Subject [^aAeEiIoOuU]
but that doesn't test if there is a vowel in the Subject but rather if
one of the non-vowel characters is in the Subject. A Subject of
"Keeper" would match because 'K', 'p', and 'r' are in the Subject and
each is in the list returned by the regular expression, so the result is
that this post gets deleted despite that it has the 'e' vowel in its
Subject.
I next thought of:
!delete Subject ^[aAeEiIoOuU]
but that probably means to look for any vowel to be at the start of the
string in the Subject header. A post with Subject "Acknowledged" would
get deleted because it starts with a vowel.
What I want is to delete the post only if the Subject is devoid of any
vowel character. If there was a nodelete action, the filter would've
simply been:
!nodelete Subject [aAeEiIoOuU]
so only posts with a vowel in the Subject are not deleted. Any ideas on
a regular express that will work?
On a side note, I'm thinking the following might work to fire on a blank
Subject header:
!delete Subject [^a-z|^A-Z|^0-9]
since I consider a string of all punctuation characters to be the same
as a blank string; i.e., a string is considered effectively blank if it
contains no alphanumeric characters.
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: Rom
Date: Fri, 11 Apr 2008 10:24
Date: Fri, 11 Apr 2008 10:24
20 lines
1637 bytes
1637 bytes
On Fri, 11 Apr 2008 02:37:52 -0500, VanguardLH wrote: > Trying to figure out in 40tude Dialog how to define a scoring filter > that will behave like a rule defined in Outlook Express. In OE, the > rule is: > > Apply this rule after the message arrives > Where the Subject line does not contain 'a' or 'e' or 'i' or 'o' or 'u' > Delete it > and Stop processing more rules ... > What I want is to delete the post only if the Subject is devoid of any > vowel character. Try this: !delete subject -"a" -"e" -"i" -"o" -"u" -- Rom
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: Rom
Date: Fri, 11 Apr 2008 11:01
Date: Fri, 11 Apr 2008 11:01
24 lines
1758 bytes
1758 bytes
On Fri, 11 Apr 2008 20:24:02 +1000, Rom wrote: > On Fri, 11 Apr 2008 02:37:52 -0500, VanguardLH wrote: > >> Trying to figure out in 40tude Dialog how to define a scoring filter >> that will behave like a rule defined in Outlook Express. In OE, the >> rule is: >> >> Apply this rule after the message arrives >> Where the Subject line does not contain 'a' or 'e' or 'i' or 'o' or 'u' >> Delete it >> and Stop processing more rules > ... >> What I want is to delete the post only if the Subject is devoid of any >> vowel character. > > Try this: > > !delete subject -"a" -"e" -"i" -"o" -"u" But doesn't work for a followup "Re: " -- Rom
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: VanguardLH
Date: Sat, 12 Apr 2008 04:41
Date: Sat, 12 Apr 2008 04:41
46 lines
2958 bytes
2958 bytes
Rom wrote: > On Fri, 11 Apr 2008 20:24:02 +1000, Rom wrote: > >> On Fri, 11 Apr 2008 02:37:52 -0500, VanguardLH wrote: >> >>> Trying to figure out in 40tude Dialog how to define a scoring filter >>> that will behave like a rule defined in Outlook Express. In OE, the >>> rule is: >>> >>> Apply this rule after the message arrives >>> Where the Subject line does not contain 'a' or 'e' or 'i' or 'o' or 'u' >>> Delete it >>> and Stop processing more rules >> ... >>> What I want is to delete the post only if the Subject is devoid of any >>> vowel character. >> >> Try this: >> >> !delete subject -"a" -"e" -"i" -"o" -"u" > > But doesn't work for a followup "Re: " I didn't think that would work. I saw the example in their samples tab in the Scoring dialog on using: +1 Subject "interest1" "interest2" "interest3" "interest4" and figured they were OR'ing the tests on the presence of those strings in the Subject. That is, if any of those string alone were in the Subject header then the post would get its score incremented. In other words, I figured that one line was equivalent to: +1 Subject "interest1" +1 Subject "interest2" +1 Subject "interest3" +1 Subject "interest4" They have another of: +1 From "user1" "user2" "user3" "user4" and I wouldn't think they could even search for a post that had all these senders for a post (since there could only be one sender) and why I figured the operands were getting OR'ed.
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: Rom
Date: Sat, 12 Apr 2008 06:27
Date: Sat, 12 Apr 2008 06:27
30 lines
2003 bytes
2003 bytes
On Fri, 11 Apr 2008 23:41:25 -0500, VanguardLH wrote: > Rom wrote: > >> On Fri, 11 Apr 2008 20:24:02 +1000, Rom wrote: >> >>> On Fri, 11 Apr 2008 02:37:52 -0500, VanguardLH wrote: [...] >>>> What I want is to delete the post only if the Subject is devoid of any >>>> vowel character. >>> >>> Try this: >>> >>> !delete subject -"a" -"e" -"i" -"o" -"u" >> >> But doesn't work for a followup "Re: " > > I didn't think that would work. I saw the example in their samples tab > in the Scoring dialog on using: > > +1 Subject "interest1" "interest2" "interest3" "interest4" > > and figured they were OR'ing the tests on the presence of those strings > in the Subject. Yeah, sorry, I was forgetting about the vowel(s) in Re: (or other prefixes) and don't know how to exclude them, if it is possible. -- Rom
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: Bernd Rose
Date: Sat, 12 Apr 2008 06:27
Date: Sat, 12 Apr 2008 06:27
15 lines
1739 bytes
1739 bytes
On Fri, 11 Apr 2008 02:37:52 -0500, VanguardLH wrote:
> So if the Subject doesn't have one, or more, vowels then the post gets
> deleted. For Dialog in a scoring rule, I first thought of:
>
> !delete Subject [^aAeEiIoOuU]
!delete Subject {(^Re:|^)[^aeiou]*$}
Replace the asterisk by a plus-sign, if you want to keep posts with
empty subject. As Dialog defaults to case-insensitive matching, you
shouldn't need to include the upper-case letters in above string.
HTH.
Bernd
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: VanguardLH
Date: Sat, 12 Apr 2008 11:05
Date: Sat, 12 Apr 2008 11:05
29 lines
2621 bytes
2621 bytes
Bernd Rose wrote:
> On Fri, 11 Apr 2008 02:37:52 -0500, VanguardLH wrote:
>
>> So if the Subject doesn't have one, or more, vowels then the post gets
>> deleted. For Dialog in a scoring rule, I first thought of:
>>
>> !delete Subject [^aAeEiIoOuU]
>
> !delete Subject {(^Re:|^)[^aeiou]*$}
>
> Replace the asterisk by a plus-sign, if you want to keep posts with
> empty subject. As Dialog defaults to case-insensitive matching, you
> shouldn't need to include the upper-case letters in above string.
>
> HTH.
> Bernd
Interesting. The "(^Re:|^)" presumably means to match on a leading
"Re:" at the start of the line or just the start of line itself along
with the next list of characters. The "[^aeiou]*" presumably means to
match on each character in the string and return it if not one of those
listed. And then the "$" anchors it to the end of the line. I wasn't
sure why you added the braces until I reread the help file on scoring
where it said "Regular expressions in the score file need to be written
in braces."
Time to sleep. I'll test this tomorrow in a *.test newsgroup and
replace delete with setcolor so I can see on which posts it trigger.
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: VanguardLH
Date: Sun, 13 Apr 2008 07:18
Date: Sun, 13 Apr 2008 07:18
44 lines
3533 bytes
3533 bytes
Bernd Rose wrote:
> !delete Subject {(^Re:|^)[^aeiou]*$}
>
> Replace the asterisk by a plus-sign, if you want to keep posts with
> empty subject. As Dialog defaults to case-insensitive matching, you
> shouldn't need to include the upper-case letters in above string.
Well, that regular expression seems to work. I sent a post with just
constonants and punctuation characters to the alt.test group. I created
the above filter for scoring but it didn't work. Then I created a
filter that set colors on any post that had "bxrt" (a substring in the
post that did show up in alt.test) and commented out the !delete line
but the post didn't get colored (red on black).
Problem came down to the group specifier. I didn't want to test the
unknown filter on my regular groups, just the alt.test group where I
posted the message with the non-vowel Subject header. To limit the
filter to just this group, I used:
[*.test]
!delete Subject {(^Re:|^)[^aeiou]*$}
I wanted the filter only to work in *.test groups, not in a group that
had "test" somewhere else in its name, like perhaps "*.betatest". I
then changed to:
[alt.test]
!delete Subject {(^Re:|^)[^aeiou]*$}
And that worked. The coloring filter worked so I removed it and
uncommented the delete filter. When I reran the scoring, the test post
got deleted. So I verified that the regular expression did indeed work.
Now I have to figure why I need to specify an actual group name in full.
Do I need to use regular expressions in the group specifier, too, like
maybe "[*\.test]" (where I escape the period character)? If that were
true, how come the asterisk works by itself instead of having to use
".*" to mean 0 or more of any character (which would probably be ".+"
since no group would have zero characters in its name)? Maybe I just
can't get complicated with the group names and am stuck with only what
the help shows for examples, which means I have to use the full group
name to include it or "-string" to omit some group that has that string
anywhere in its name.
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: Bernd Rose
Date: Sun, 13 Apr 2008 07:53
Date: Sun, 13 Apr 2008 07:53
44 lines
3003 bytes
3003 bytes
Am Sun, 13 Apr 2008 02:18:13 -0500 schrieb VanguardLH:
>> !delete Subject {(^Re:|^)[^aeiou]*$}
[...]
> Well, that regular expression seems to work.
Sure. ;-)
> [*.test]
[...]
> I wanted the filter only to work in *.test groups, not in a group that
> had "test" somewhere else in its name, like perhaps "*.betatest".
Use:
[.test]
But be aware, that the above string also catches *.testimonial or groups
like that. Use regular expressions, if you need more control (see below).
> Now I have to figure why I need to specify an actual group name in full.
> Do I need to use regular expressions in the group specifier, too, like
> maybe "[*\.test]" (where I escape the period character)?
The correct RegEx version is:
[{^.+\.test$}]
> how come the asterisk works by itself instead of having to use
> ".*" to mean 0 or more of any character (which would probably be ".+"
> since no group would have zero characters in its name)?
Think of the asterisk in normal usage cases as a placeholder for specific
situations, not the RegEx "0 or more repetitions". It can be used to
represent all groups and all subgroups in a hierarchy (and all mails
and postings in case of the double-asterisk). To create a RegEx, you
(again) need to include the whole string in curly braces.
> Maybe I just can't get complicated with the group names and am stuck with
> only what the help shows for examples, which means I have to use the
> full group name to include it or "-string" to omit some group that has
> that string anywhere in its name.
As you can see: Target group strings can be fairly advanced. ;-)
Bernd
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: VanguardLH
Date: Sun, 13 Apr 2008 10:17
Date: Sun, 13 Apr 2008 10:17
11 lines
1955 bytes
1955 bytes
Bernd Rose wrote:
>> Now I have to figure why I need to specify an actual group name in full.
>> Do I need to use regular expressions in the group specifier, too, like
>> maybe "[*\.test]" (where I escape the period character)?
>
> The correct RegEx version is:
> [{^.+\.test$}]
Comes down to that I'm just not used to enclosing the regex within
braces.
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: Bernd Rose
Date: Sun, 13 Apr 2008 11:58
Date: Sun, 13 Apr 2008 11:58
11 lines
1658 bytes
1658 bytes
On Sun, 13 Apr 2008 05:17:37 -0500, VanguardLH wrote:
>> The correct RegEx version is:
>> [{^.+\.test$}]
>
> Comes down to that I'm just not used to enclosing the regex within
> braces.
It seems so. ;-)
Bernd
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: Oliver Cromm
Date: Tue, 15 Apr 2008 23:20
Date: Tue, 15 Apr 2008 23:20
14 lines
2032 bytes
2032 bytes
* Bernd Rose wrote:
> The correct RegEx version is:
> [{^.+\.test$}]
For a long time I wonder why so many people always try to match the
whole string in a RegEx, while they seem to be comfortable with partial
matches in a string match.
[{.\.test$}] should do exactly the same as above. And [{\.test$}] should
suffice as well, as no group will start with a dot.
--
ASCII to ASCII, DOS to DOS
Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
Author: Bernd Rose
Date: Wed, 16 Apr 2008 18:59
Date: Wed, 16 Apr 2008 18:59
43 lines
3470 bytes
3470 bytes
Am Tue, 15 Apr 2008 19:20:56 -0400 schrieb Oliver Cromm:
>> The correct RegEx version is:
>> [{^.+\.test$}]
>
> For a long time I wonder why so many people always try to match the
> whole string in a RegEx, while they seem to be comfortable with partial
> matches in a string match.
>
> [{.\.test$}] should do exactly the same as above. And [{\.test$}] should
> suffice as well, as no group will start with a dot.
Two reasons: a special one applying here and a more general one: The
reason why I used the long version here is that the post is just an
example for a concept. I believe VanguardLH has a good understanding
of RegEx. But many people who come across this thread will have
problems that are though comparable, yet not identical. Therefore I
usually try to display as much concepts as possible with such terms
as above. I even thought about mentioning the shorter versions, but
decided against that to keep the post lean.
When I try to get people that are unfamiliar with regular expressions
to really understand their principle workings, I nearly always noticed
that they easier understand a whole line parsing RegEx, rather than
partial matching. Adjusting the above to only match 'test' groups in
the 'alt' hierarchy will be an easy task even for most newbies, while
it will be very hard for many to extend the partial matching form...
The second reason for complete matching pertains to situations, where
assumptions about the possible matches may be faulty. If VanguardLH
had a folder by the name .test inside Dialog, he might be *very*
displeased with the results of the new filter when only partial
matching is used. ;-)
Again, I don't think this would have been a problem with VanguardLH,
but it could be one with somebody applying the principle to a
seemingly similar situations.
I hope this clarifies *my* thoughts while writing the above RegEx
string. The reasons for other people posting "full line matching"
strings may vary...
Bernd
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