Hi Paul,
> Separated with something that ASSP knows as a separator(so it
> doesn¹t see it as a static string/phrase)
I think the syntax of the (ASSP-) regular expressions is complicated
enough.
But, Perl regular expressions are just able to do this for you.
Let's have a look at your example words.
> member stretch huge her
Change this line to:
\bmember\b.*?\bstretch\b.*?\bhuge\b.*?\bher\b - all the words in the
right order where ever they are in the mail
I know, you want it order independent - to do this you have to define all
24 (4! - 1*2*3*4) possible combinations of the 4 words, if you want to go
it this way. (Hm.....)
or use it this way
(\bmember\b|\bstretch\b|\bhuge\b|\bher\b).*?(\bmember\b|\bstretch\b|\bhuge\b|\bher\b).*?(\bmember\b|\bstretch\b|\bhuge\b|\bher\b).*?(\bmember\b|\bstretch\b|\bhuge\b|\bher\b)
or the same - more easy
(\bmember\b|\bstretch\b|\bhuge\b|\bher\b){4,}
Both will find any of combinations of the 4 words in any count - but also
- for example
<member member huge huge huge> or
<her huge member member> or
<huge stretch stretch her>
but also
<her her her her> ????
or use a low weight for each word, setting the weight so, that the sum of
all the weights (penalty) is high enough to mark the mail as spam
\bmember\b=>15
\bstretch\b=>15
\bhuge\b=>15
\bher\b=>15
For one word the resulting penalty is 15 , for any of two 30, for any of
three 45 and for all the words the resulting penalty would be 60.
or an other way using weights
\bmember\b.*?\bstretch\b=>30
\bstretch\b.*?\bmember\b=>30
\bhuge\b.*?\bher\b=>30
\bher\b.*?\bhuge\b=>30
>However it would still be nice to
>have some more flexibility in the bomb/black files.
As you can see, flexibility is not a problem.
And all the examples above are easy to understand and to handle.
But don't be shy, Perl has no problem to execute complex regular
expressions.
Someone would say - this (your request) is easy to do with (what ever
easy is):
((\bmember\b|\bstretch\b|\bhuge\b|\bher\b).*?(?!\g{-1})){4}
which meens: all of the 4 words must be present in any order - all words
could be present multiple times
I think this is exactly what you wanted to do!
This regex will do it as flexible as you want it - put the words you want
to search for in the second brackets part and define how many words must
be found, in the last scope {x}.
Thomas
Paul Dickson <[email protected]>
08.07.2009 19:58
Bitte antworten an
ASSP development mailing list <[email protected]>
An
ASSP development mailing list <[email protected]>
Kopie
Thema
[Assp-test] FW: [Assp-user] FW: Black/bomb word combinations.
> Fritz and Tom:
>
> What do you think about the idea of expanding the
> capabilities of black and bomb re¹s to look for word
> combinations rather than just static phrases.
> For instance if I put on one line
>
> member stretch huge her
>
> Separated with something that ASSP knows as a separator(so it
> doesn¹t see it as a static string/phrase), then if an email
> contains all of the listed words it will be considered spam.
> I realize Bayesian is supposed to take care of this and for
> 95% of the mail it does. However it would still be nice to
> have some more flexibility in the bomb/black files. Or
> perhaps separate files * shrug *.
>
> Thoughts?
>
>
> Paul K. Dickson
> Systems Administrator
> Frederick County Government, IIT
> [email protected]
> 301-600-2399/x12399
----------------------------------------------------------------------------
--
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Assp-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-user
------ End of Forwarded Message
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Assp-test mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-test
DISCLAIMER:
*******************************************************
This email and any files transmitted with it may be confidential, legally
privileged and protected in law and are intended solely for the use of the
individual to whom it is addressed.
This email was multiple times scanned for viruses. There should be no
known virus in this email!
*******************************************************
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Assp-test mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-test