1. I want to find a string that matches on the regular expression /peni(s|$)/. I want to temporarily store the string that matched, and then test whether it includes the character "$". The idea being that a hit on "peni$" will score higher than a hit on "penis". What is the best way to store a matched string and perform further tests just on that string?
Why do you want storage here? If you want to make two scores, you _HAVE_ to make two rules... If you have to make two rules, write one that matches penis, and one that matches peni$ and give them separate scores.. anything else is just wasting cpu time by over-complicating the problem.
If however you do want to do combination matches (this is NOT a good use for one) check into meta rules.. the rule guide has examples.
http://mywebpages.comcast.net/mkettler/sa/SA-rules-howto.txt
2. Similarly, I would like to create a rule that penalizes the appearance of the recipient name in the subject of an email. This rule would first parse the "to" field and extract and store the recipient's mail name ("ehart" for example). It would then test the subject field to see if this stored mail name is contained in the subject.
This one would need to be an eval test. There's currently no way in a normal rule to look to see if a variable substring in one header matches is also in another header. You can look for "ehart" in both, by using a meta rule, but it won't be able to dynamically see if any other usernames do the same thing.
------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk