[prev in list] [next in list] [prev in thread] [next in thread] 

List:       spamassassin-users
Subject:    RE: Rule to catch PO#
From:       Bowie Bailey <Bowie_Bailey () BUC ! com>
Date:       2008-12-02 17:35:25
Message-ID: 4766EEE585A6D311ADF500E018C154E302B4D7F8 () bnifex ! cis ! buc ! com
[Download RAW message or body]

Karsten Bräckelmann wrote:
> > > > 
> > > > header PO_AND_ORDERS        Subject =~ /\bPO*?#?/i
> 
> Btw, you need to escape the hash '#', not because this is an RE, but
> because it is Perl. :)

You don't need to escape the hash in a Perl RE unless you are using hash
characters for the RE boundary markers.

> > ?I need to match all of the ollowing:
> > PO
> > PO#
> > PO  [0-9] - im not sure the max amount of numbers
> > PO#  [0-9] - im not sure the number of numbers
> > PO[0-9] - not sure how many numbers
> > PO#[0-9] - not sure how many numbers
> 
> That's easy.  /\bPO\b/ will do -- might hit on spam as well, though,
> since it is really short.

Except that RE won't match "PO12345" since letters and numbers are both
word characters.

-- 
Bowie

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic