I used gmail api to get the email content and then in node.js I convert it to string.
Buffer.from(dataToDecode, 'base64').toString('utf8')
Then I use regular expression to search dates in the text. e.g. Feb 27, 2019
/[A-Z][a-z]{2} [0-9]{2}, [0-9]{4}/g
It gives no match, but when I console.log the content, the date is present. And then I copy the date to some online decoding tools, it turns out
\xe2\x80\x8c\x46\xe2\x80\x8c\x65\xe2\x80\x8c\x62\xe2\x80\x8c\x20\xe2\x80\x8c\x32\xe2\x80\x8c\x37\xe2\x80\x8c\x2c\xe2\x80\x8c\x20\xe2\x80\x8c\x32\xe2\x80\x8c\x30\xe2\x80\x8c\x31\xe2\x80\x8c\x39\xe2\x80\x8c\x0a
and
\x46\x65\x62\x20\x32\x37\x2c\x20\x32\x30\x31\x39
can both gives to the same 'Feb 27, 2019'. How to use regular expression to capture the first type encoding (i.e. the longer encoding)?