View previous topic :: View next topic |
Author |
Message |
fhurst
Trooper
Joined: Apr 09, 2004
Posts: 19
Location: USA
|
Posted: Mon Jun 07, 2004 4:30 pm Post subject: Create filters that exclude changing numbers in From address |
|
|
I want to create a filter for my Friends List which will recognize an address from which I occasionally receive e-mail. When mail from that address arrives, it is the same each time, except for the numbers, which change with every new e-mail.
In the following example I want to have MailWasher recognize the address but exclude the numbers.
Example:
From: Charlie <[email protected]>
I've tried to make sense of the FAQs on filters and even read up on RegExpr but, all of it was Greek. The more I read the less I understood. Please don't explain, unless, you wish to explain it for someone else's benefit, it will just confuse me more.
But, if it would please you to rewrite my example, the way it should look so that I could do the same with the real address and paste it in, I would be much appreciative.
Your Friend,
Ferrell |
|
Back to top |
|
|
stan_qaz
General
Premium Member
Joined: Mar 31, 2003
Posts: 4119
Location: USA
|
Posted: Mon Jun 07, 2004 10:06 pm Post subject: |
|
|
Try this:
charlies-carwash@*.win3.social.net |
|
Back to top |
|
|
AlphaCentauri
Captain
Joined: Nov 20, 2003
Posts: 302
Location: USA
|
Posted: Tue Jun 08, 2004 11:58 am Post subject: |
|
|
The other way is to create a filter to designate the email as legitimate by looking for RegExp charlies-carwash@abcd\d\d\.win3\.social\.net
I wish the Friends list could use RegExps. |
|
Back to top |
|
|
fhurst
Trooper
Joined: Apr 09, 2004
Posts: 19
Location: USA
|
Posted: Tue Jun 08, 2004 3:48 pm Post subject: Create filters that exclude changing numbers in From address |
|
|
AlphaCentauri wrote: |
The other way is to create a filter to designate the email as legitimate by looking for RegExp charlies-carwash@abcd\d\d\.win3\.social\.net
I wish the Friends list could use RegExps. |
I have since learned that the number 3 can change as well from e-mail to e-mail do I put forward slashes with a "d" in the middle, in place of the 3, as well?
|
|
Back to top |
|
|
fhurst
Trooper
Joined: Apr 09, 2004
Posts: 19
Location: USA
|
Posted: Tue Jun 08, 2004 3:57 pm Post subject: Create filters that exclude changing numbers in From address |
|
|
stan_qaz wrote: |
Try this:
charlies-carwash@*.win3.social.net |
I have since discovered that the 3 may change from e-mail to e-mail as well.
What does the Asterisk do here?
Does it mean: any number here?
What about the "abcd" part of the address ahead of the first number?
Can it also be written: charlies-carwash@abcd*.win*.social.net[/quote] ?
|
|
Back to top |
|
|
AlphaCentauri
Captain
Joined: Nov 20, 2003
Posts: 302
Location: USA
|
Posted: Tue Jun 08, 2004 3:58 pm Post subject: |
|
|
charlies-carwash@abcd\d\d\.win\d\.social\.net
\d is any digit
\. is a real "." since "." is the Regular Expression for any character or space.
You would use this in a filter rather than the friends list. The asterisk works in the friends list (and means any number of characters fit in that space), but the other regular expressions don't work. |
|
Back to top |
|
|
stan_qaz
General
Premium Member
Joined: Mar 31, 2003
Posts: 4119
Location: USA
|
Posted: Wed Jun 09, 2004 10:09 am Post subject: |
|
|
if the 3 is a single letter try:
charlies-carwash@abcd*.win?.social.net
? matches one letter
* matches one or more letters
The regex filter is more precise if you can get it working. |
|
Back to top |
|
|
fhurst
Trooper
Joined: Apr 09, 2004
Posts: 19
Location: USA
|
Posted: Wed Jun 09, 2004 11:51 am Post subject: |
|
|
stan_qaz wrote: |
if the 3 is a single letter try:
charlies-carwash@abcd*.win?.social.net
? matches one letter
* matches one or more letters
The regex filter is more precise if you can get it working. |
Looking at the your two examples I am beginning to understand, with each new post you and AlphaCentauri make, a little more. I believe I can make the simpler of the two but, at the same time I wish to understand the more precise method that AlphaCentauri is trying to explain.
If I understand the following expression, sans the quotes, " \d " represents any SINGLE digit and I would repeat that expression to represent two digits as: " \d\d " , and not as: " \d\d\ " , since the real dot followed by the last " \ " would be recognized as a RegExp rather than as the real dot that it is in the original address.
I welcome both of you to respond.
I thank you both for your responses as both of you are most helpful.
With Total Appreciation,
Ferrell
|
|
Back to top |
|
|
AlphaCentauri
Captain
Joined: Nov 20, 2003
Posts: 302
Location: USA
|
Posted: Wed Jun 09, 2004 11:56 am Post subject: |
|
|
You've got it! |
|
Back to top |
|
|
Ikeb
General
Premium Member
Joined: Apr 20, 2003
Posts: 3555
Location: Canada
|
Posted: Wed Jun 09, 2004 4:31 pm Post subject: |
|
|
Just keep in mind that Stan's suggested structure works only in the Friends / Blacklist while AC's suggested structure only works as a filter, specifically a regex filter.
Clear as mud eh?
_________________
I like SPAM ... on my sandwich! |
|
Back to top |
|
|
fhurst
Trooper
Joined: Apr 09, 2004
Posts: 19
Location: USA
|
Posted: Wed Jun 09, 2004 5:41 pm Post subject: |
|
|
AlphaCentauri wrote: |
charlies-carwash@abcd\d\d\.win\d\.social\.net
\d is any digit
\. is a real "." since "." is the Regular Expression for any character or space.
You would use this in a filter rather than the friends list. The asterisk works in the friends list (and means any number of characters fit in that space), but the other regular expressions don't work. |
What if the numbers change from 1 to 2 digits and then from 2 to 3 digits, or more for that matter, and then back to 1, or 2 the next e-mail? There has to be a symbol for fluctuating numbers where the amount of digits change regularly as well as their individual values.
For example, my original address had a two digit number in the string as well as a single digit later in the string. What if that first or, both those numbers, not only changed value (say the first number 29 becomes 40) but the number of total digits change as well (the 29 becomes 112 at the next e-mail).
I hope I worded that well enough.
Your Friend,
Ferrell
|
|
Back to top |
|
|
AlphaCentauri
Captain
Joined: Nov 20, 2003
Posts: 302
Location: USA
|
Posted: Wed Jun 09, 2004 5:56 pm Post subject: |
|
|
charlies-carwash@abcd\d\d\.win\d\.social\.net|
charlies-carwash@abcd\d\.win\d\.social\.net|
charlies-carwash@abcd\d\d\d\.win\d\.social\.net
(these really all go on one line with no spaces, but the text won't wrap
on this forum if I do that and some folks will get teed off )
the "|" (capital "\" on my keyboard) means "or" So if any of the
above are true (one, two or three digits after abcd) the whole statement
is true. |
|
Back to top |
|
|
Ikeb
General
Premium Member
Joined: Apr 20, 2003
Posts: 3555
Location: Canada
|
Posted: Wed Jun 09, 2004 7:35 pm Post subject: |
|
|
IIRC, there needs to be '()' brackets around the whole thing. Actually, the whole regex AC suggests, can be compressed to:
Code: |
charlies-carwash@abcd\d{1,3}\.win\d\.social\.net |
If the number of digits can vary, determine the upper number. If, for example, the upper number is 5, the regex would be:
Code: |
charlies-carwash@abcd\d{1,5}\.win\d\.social\.net |
_________________
I like SPAM ... on my sandwich!
|
|
Back to top |
|
|
fhurst
Trooper
Joined: Apr 09, 2004
Posts: 19
Location: USA
|
Posted: Wed Jun 09, 2004 7:55 pm Post subject: |
|
|
Ikeb wrote: |
IIRC, there needs to be '()' brackets around the whole thing. Actually, the whole regex AC suggests, can be compressed to:
Code: |
charlies-carwash@abcd\d{1,3}\.win\d\.social\.net |
If the number of digits can vary, determine the upper number. If, for example, the upper number is 5, the regex would be:
Code: |
charlies-carwash@abcd\d{1,5}\.win\d\.social\.net |
|
So what this says is:
1. that any digit ( " \d " ), in this place in the string, can be any value and
2. that there can be any number of digits from 1 to 5
( " {1,5} " ) and each one can be of any value. Correct?
Your Friend,
Ferrell
|
|
Back to top |
|
|
Ikeb
General
Premium Member
Joined: Apr 20, 2003
Posts: 3555
Location: Canada
|
Posted: Wed Jun 09, 2004 8:05 pm Post subject: |
|
|
1. Yes in either regex.
2. Yes in the second regex
_________________
I like SPAM ... on my sandwich! |
|
Back to top |
|
|
|