email-reply-parser
email-reply-parser copied to clipboard
Issue with parsing Samsung reply
When trying to parse this:
This is pretty awesome, nice work!Sent from my Verizon, Samsung Galaxy smartphone
-------- Original message --------From...
(I excluded the quoted reply, but it is there)
I would expect the output to be:
This is pretty awesome, nice work!
But instead I get the whole text.
I'm not sure what you can do about the Sent from...
part because you probably don't want to cut off sentences that just happen to start with "Sent from". But I think you can add optional spaces to the regex and remove the end of line requirement like so:
/^-{1,10} ?Original message ?-{1,10}/
To at least handle the reply.
Can you provide a bigger extract of this email?
I see two things here:
- Adding a regex for Sent from my (.), (.) smartphone
- Updating the Original message regex
Sure, I have edited the emails and original text for privacy.
This is pretty awesome, nice work!Sent from my Verizon, Samsung Galaxy smartphone
-------- Original message --------From: [email protected] Date: 1/13/22 3:52 PM (GMT-06:00) To: [email protected] Cc: [email protected] Subject: Status Updated
blah blah blah
I think those are both good options. The original message regex seems more important because the chain of previous messages could be very long.
Hello!
Issue should be solved now :)