in message <20020824131425(_dot_)GA862(_at_)pop(_dot_)gmx(_dot_)net>,
wrote Holger Wahlen thusly...
To determine a folder name from a bracketed word in the subject line,
* ^Subject:[ ]*\[\/[^]]\]
* MATCH ?? ()[^]]
in the "* Subject:", first $MATCH is set to text matched by
"[^]]\]". later, the last ']' is removed by matching only "[^]]".
You'd have to use \/ for that again, I guess you just forgot.
[ snippet is replied later ]
Oh yeah, and the bracketed word is likely to have more than just
oh crap! i missed it big time; thanks for catching.
But why include the closing bracket ... in MATCH at all? Simply
omit it in the first line already.
for the same reason one may want to use '[a-z0-9]+' instead of
'[^]]+': to exert control on the text being matched.
first time, i started my above recipe w/ correct regex & '\/'; then
i changed to your above proposed solution (did away w/ 2d MATCH).
being cautious that i am, i reverted but forgot to update the
recipe in between the changes. (not too cautious, hunh?)
to repent, below is the corrected moderately cautious version...
* ^Subject:[ ]*\[\/[^]]+\]
* MATCH ?? ()\/[^]]+
....and this one is the short version as suggested by holger (which
i didn't & don't like)...
* ^Subject:[ ]*\[\/[^]]+
...oh, there is one space & a tab inside '' after 'Subject:'.
procmail mailing list