You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some emails that come in with a pattern like:
From: NAME
Sent: blah blah blah
These don't match the regex /^\s*(From\s?:.+\s?(\[|<).+(\]|>))/ because they lack the <EMAIL> segment. So rather than change the existing I tried a regex like:
/^\s*(From\s?:.+\nSent:\s?.+)/
But this fails to match in isQuoteHeader() due to the way newlines are replaced at the beginning of the parse() method. So I changed it to:
/^\s*(From\s?:.+(\n| )Sent:\s?.+)/
This matches either a newline or it's replacement a space- and seems to work but I end up with a single line and I'd rather not have the resulting text be altered. Also, I'm not entirely sure that this wouldn't end up matching things incorrectly in the isQuoteHeader() method. Can you offer any advice here on how to match a multiline pattern? Is there a cleaner way to handle this?
Thanks again for the excellent library, it's really coming in handy.
The text was updated successfully, but these errors were encountered:
I have some emails that come in with a pattern like:
These don't match the regex
/^\s*(From\s?:.+\s?(\[|<).+(\]|>))/
because they lack the<EMAIL>
segment. So rather than change the existing I tried a regex like:/^\s*(From\s?:.+\nSent:\s?.+)/
But this fails to match in
isQuoteHeader()
due to the way newlines are replaced at the beginning of theparse()
method. So I changed it to:/^\s*(From\s?:.+(\n| )Sent:\s?.+)/
This matches either a newline or it's replacement a space- and seems to work but I end up with a single line and I'd rather not have the resulting text be altered. Also, I'm not entirely sure that this wouldn't end up matching things incorrectly in the
isQuoteHeader()
method. Can you offer any advice here on how to match a multiline pattern? Is there a cleaner way to handle this?Thanks again for the excellent library, it's really coming in handy.
The text was updated successfully, but these errors were encountered: