procmail
[Top] [All Lists]

Re: extract part of subjkect line into variable?

1999-04-07 07:27:58
Mathias Koerber wrote:

        Subject: [xx] re: test

I would like to assign the "xx" in the squarebrackets into a variable.

You could first grab everything after the opening bracket into MATCH
and then cut off the rest in a second step: 
        :0
        * ^Subject:[    ]*\[\/.*].*
        {
                IN_BRACKETS =| echo $MATCH | sed 's-].*--'
                # or maybe you prefer  ... | cut -d] -f1
        }

/HW