package main
import (
"fmt"
"github.com/dimiro1/reply"
)
func main() {
message := `
This is before the embedded email.
On Wed, Sep 25, 2013, at 03:57 PM, richard_clark wrote:
Richard> This is the embedded email
This is after the embedded email and will not show up because 99% of the times
this is the signature...
`
fmt.Println(reply.FromText(message))
}
This package has a dependency on excellent regex library github.com/dlclark/regexp2.
The reason for not using the standard regex library was due to the fact that
the regex package from the stdlib is not compatible with the library from the Ruby stdlib.
All the tests were taken from the email_reply_trimmer library.
Note:
This code is not idiomatic go code, as, it was mostly adapted from the ruby code,
however, the public APIs were kept simple as possible and does not expose any internal.