Bowie Bailey wrote:
Ray Jette wrote:
Good morning,
I am trying to write a negative scoring rule that files on the
following: PO
PO#
PO #

Following is the rule I am using:

header PO_AND_ORDERS        Subject =~ /\bPO*?#?/i
score PO_AND_ORDERS        -0.50
describe PO_AND_ORDERS    A negative scoring rule that searches the
subject for PO #'s.

Thanks for any help you can provide.

Try this one:

    Subject =~ /\bPO\b ?#?/i

The "\b" after the "PO" will prevent it from matching things like
"positive", "pollen", or anything else that happens to start with "po".
Keep in mind that the "i" at the end makes it case-insensitive, so this
will match "PO", "po", "pO", etc.

Sometimes the subject will be: PO#34598459 so do I realy want to us \b?
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

Thanks,
Ray

Reply via email to