Re: Extract last email from an email file (mbox format)
Xu Wang <[email protected]> Thu, 26 May 2016 23:00:32 -0400
| Newsgroups | gmane.mail.procmail |
|---|---|
| Message-ID | <CAJhTkNhJr7O7+LUH3dNMTHeJ36rqNm0YK5RivjNH=o=Hh1FZHg@mail.gmail.com> |
On Thu, May 26, 2016 at 9:51 PM, John Levine <[email protected]> wrote: >>I think I have a fundamental misunderstanding somewhere. Perhaps I am >>not using the mbox format? The file I wish to get last message of is >>the send file from mutt. Here is the last message, for example: > > ---------------------------------begin last message > From [email protected] Thu May 26 20:55:32 2016 > > That line begins with From followed by a space, which > is what '^From ' matches. You might want to look for > some tutorials on regular expressions if you don't > understand how they work. Regular expressions are actually the only part of this conversation that I feel much confidence in. >>From: will this be matched? > > Nope, has a colon. > > >From how about this one? > > If the mbox is created by any of the usual mail programs, > the mail program puts a > in front of any line that might > otherwise match '^From ' OK this is the root of the misunderstanding. I'm not sure why but mutt has not done this. Kind regards, Xu