procmail
[Top] [All Lists]

Re: regex syntax question

2004-03-10 15:52:34
Toen ik Dallman Ross kietelde, kwam er dit uit:

    :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.

How much time does the looping take? It should be 
compared against building a variable of about a 
1000 dots and using that as a regexp.

   dots = "................"    #  16
   dots = $dots$dots$dots$dots  #  64
   dots = $dots$dots$dots$dots  # 256
   :0
   *$ B_chunkA ^^\/$dots$dots$dots$dots
   { B_chunkA = $MATCH }
   dots  # unset

-- 
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>