procmail
[Top] [All Lists]

Re: regex syntax question

2004-03-18 07:51:12
Toen ik Ruud H.G. van Tol kietelde, kwam er dit uit:
Dallman Ross:
Ruud:

    :0
    * B ?? ^^\/.*$*.*$*.*$*.*$*\
               .*$*.*$*.*$*.*$*\
               .*$*.*$*.*$*.*$*\
               .*$*.*$*.*$*.*$*.*
    { B_chunkA = $MATCH }

That regex will trip the 'Exceeded LINEBUF' message,
now and then. A better way puts at most 1000 bytes
(for example) of the body into B_chunk.

  MAXINT = 2147483647
  :0
  *      -1000^0
  * $  $MAXINT^0
  *          1^1  B ?? ^^\/(.*$?)*
  { B_chunkB = $MATCH }

Real nice.

I have to withdraw that.

  MAXINT = 2147483647
  zz = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
  :0
  *      -10^0
  *$ $MAXINT^0
  *        1^1 zz ?? ^^\/.*
  { zz_Top = $MATCH }

does not do what I interpreted that your technique would.

There is (1.a) no 'real nice' way to match the first N bytes 
of a buffer, you must (1.b) create a var that holds N dots 
first (which I know is (2) trivial to do).

So please proof me wrong on (1).

-- 
Affijn, Ruud

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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