LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] simpletcp regex problem

To: Stefan König <nme@xxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] simpletcp regex problem
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Thu, 3 Dec 2009 08:35:15 +1100
On Wed, Dec 02, 2009 at 05:06:06PM +0100, Stefan König wrote:
> Hello list,
> 
> I  want to use checktype=negotiate with service=simpletcp on spamassassin.
> As a request I use "PING SPAMC/1.0" and spamd does reply with "SPAMD/1.4
> 0 PONG" (verified with netcat).
> Now I have trouble with the receive regex. I just does not work:
> 
> receive="(\bSPAMD\b.*)"
> 
> I verified the regex on regexplanet
> (http://www.regexplanet.com/simple/index.html) and it seems to work fine.
> This is troubeling me for hours now.
> Could someone give me a hint?

Hi Stefan,

I think that the problem is that you need to escape the \b.
Could you try receive="(\\bSPAMD\\b.*)" ?

I tested this using the following:

#!/usr/bin/perl

my $test = "SPAMD/1.4 0 PONG";
my $re1 = "(\bSPAMD\b.*)";
my $re2 = "(\\bSPAMD\\b.*)";

if ($test =~ m/$re1/) {
        print "1: ok\n";
}
else {
        print "1: fail\n";
}

if ($test =~ m/$re2/) {
        print "2: ok\n";
}
else {
        print "2: fail\n";
}


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users
<Prev in Thread] Current Thread [Next in Thread>