procmail
[Top] [All Lists]

RE: Subset of Body

1999-05-28 16:01:56
Thanks, David, for taking the time!!

--> -----Original Message-----
--> From: David W. Tamkin [mailto:dattier(_at_)Mcs(_dot_)Net]
--> Sent: Friday, May 28, 1999 12:48 PM
--> | First off, I am having trouble matching "Name:" in the body.  I am trying:
--> |
--> |   :0
--> |   * ^Name:
--> |   {
--> |           ... ???
--> |   }
-->
--> You need the B flag (capital B; lower-case b means something else) on the
--> flag line to make regexp conditions search the body, or you need to
--> start the
--> condition itself with   B ??  to set its search area to be the body.  HB
--> means both head and body; H alone is the default (you'll still see  H ??  if
--> the flag line has B or HB but one condition needs to search only the head).
Yup!  It now matches!  Thanks!  Next...

--> | ... will I need to call a sed, awk, or perl script to get the next N
--> | characters?
-->
--> That depends on the value of N and on whether it can include newlines.

N will be between 100 and 250 (the size of the page I can send).  Yes, it can
include newlines.  Format:

Name:  xxxxx
Phone: xxxxx
Message: xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx...

--> For example, what if there is a newline within the first N characters?
No doubt there will be.
--> Should the extraction stop, should the newline be counted, or should it
--> not be counted?
Continue the extraction to N.  Count the newline.
-> Should spaces immediately after the colon in "Name:" be
--> counted toward the N characters?
Yes.
-->
--> You might even be able to do it within procmail or with head(1), but you'll
--> need to tell us a lot more.
-->
I hope so and I hope I have!

Thanks again!  This list is great.  You guys really HELP (unlike some of the
PERL lists... ;-} )

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