EmailReplyParser icon indicating copy to clipboard operation
EmailReplyParser copied to clipboard

Add some variations to signature Regex

Open mcki0127 opened this issue 7 years ago • 3 comments

@willdurand I would like to add "Sent via the", "Sent from the", and "Sent from" to the signature Regex. These are standard Android/Galaxy signatures.

/(?:^\s*--|^\s*__|^-\w|^-- $)|(?:^Sent (from|via) (my|the )?(?:\s*\w+){1,4}$)|(?:^={30,}$)$/s

Is this acceptable?

mcki0127 avatar Jan 05 '19 19:01 mcki0127

The same problem: I need to add russian variant. There's polish has variants "pisze|napisał", but russian/ukranian has only "написа(л|ла|в)". There's "пише(|т)" need to be added.

abrgitlab avatar Jan 17 '19 11:01 abrgitlab

You can set the signature regex to whatever you like, like this:

$parser = new \EmailReplyParser\Parser\EmailParser();
$parser->setSignatureRegex('/your regex here/s');
$content = $parser->parse($string)->getVisibleText();

petski avatar May 21 '19 08:05 petski

yes, this came with 2.7.0 release:

  • https://github.com/willdurand/EmailReplyParser/pull/45

glensc avatar Mar 24 '20 20:03 glensc