procmail
[Top] [All Lists]

Re: extract part of subjkect line into variable?

1999-04-07 10:13:19
"Mathias Koerber" <mathias(_at_)koerber(_dot_)org> writes:
But that is not what I want to do. I want to extract the 911, not
what is left behind it.
\/ does not provide that solution...

Yes it does.  You just need to change the regexp.

        :0 fhw
        * ^Subject: *\[\/[^]]+
        { VAR = $MATCH }

"Starting at the beginning of a line, match the (case-insensitive)
 string 'subject:', then zero or more spaces, then an open bracket.
 Starting there, extract as many as possible consecutive non-close
 bracket characters, requiring at least one to count the condition as
 successful."


Philip Guenther

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