procmail
[Top] [All Lists]

Re: Special character on the Subject line

2007-06-08 07:37:14
On Friday,  8 June, 2007 at 10:14:30 -0400, Alex Kosach wrote:
I need to extract a number from the subject line where Subject line is
something like that:

Some text (Customer #12345679)


My current recipe is the following:

:0
 * ^Subject: .*Customer # ()\/[0-9]+

                           ^
                           |
There is no space at this location in your example.

I just tried the following variation on your recipe with an email with
the Subject "Some text (Customer #12345679) and it worked.  Perhaps your
extra space is the problem.

:0
* ^Subject:.*Customer..()\/[0-9]+
* MATCH ?? ^^\/[0-9]+
{ CUST_NO = $MATCH }

Note the first dot after the word Customer matches the space and the
second the #.  (I was leary of putting a hash in the condition line even
though the friendly manual says it is okay.)

Here is an extract from mu log file for the test:

procmail: [37064] Fri Jun  8 15:28:05 2007
procmail: Assigning "MATCH="
procmail: Matched "12345679"
procmail: Match on "^Subject:.*Customer..()\/[0-9]+"
procmail: Matched "12345679"
procmail: Match on "^^\/[0-9]+"
procmail: Assigning "CUST_NO=12345679"


Does this help?


Cheers,
       Nick.
-- 
Please do not CC me on replies, I read the list and don't need the dupes.
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>