procmail
[Top] [All Lists]

Re: Subset of Body

1999-05-28 13:07:07
Bill Gray asked,

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

| Once I get the match to work (any help here?)....

See above.

| ... 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.
For example, what if there is a newline within the first N characters?
Should the extraction stop, should the newline be counted, or should it
not be counted?  Should spaces immediately after the colon in "Name:" be
counted toward the N characters?

You might even be able to do it within procmail or with head(1), but you'll
need to tell us a lot more.

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