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