Mailing List Archive

svn commit: rev 6659 - incubator/spamassassin/trunk/lib/Mail/SpamAssassin
Author: felicity
Date: Sun Feb 15 13:46:14 2004
New Revision: 6659

Modified:
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
Log:
split up the meta token RE to be a bit more readable

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm Sun Feb 15 13:46:14 2004
@@ -1788,9 +1788,24 @@
# Go through each rule and figure out what we need to do
foreach $rulename (@metas) {
my $rule = $self->{conf}->{meta_tests}->{$rulename};
- my @tokens =
- $rule =~ m/([\w\.\[][\w\.\*\?\+\[\^\]]+|[\(\)]|\|\||\&\&|>=?|<=?|==|!=|!|[\+\-\*\/]|\d+)/g;
my $token;
+
+ # Lex the rule into tokens using a rather simple RE method ...
+ my @tokens =
+ $rule =~ m/(
+ [\w\.\[][\w\.\*\?\+\[\^\]]+| # Rule Name
+ [\(\)]| # Parens
+ \|\|| # Boolean OR
+ \&\&| # Boolean AND
+ \^| # Boolean XOR
+ !| # Boolean NOT
+ >=?| # GT or EQ
+ <=?| # LT or EQ
+ ==| # EQ
+ !=| # NEQ
+ [\+\-\*\/]| # Mathematical Operator
+ \d+ # A Number
+ )/gx;

# Set the rule blank to start
$meta{$rulename} = "";