0

I want to search inside a Emailbody to the subject. I use

var msgHeader = (data.match(/Subject:\s*(.+)\s+To/i))[1];

But I have now a problem. Inside the Subject there is also a To so the header is cut unhappy. I need to expand the string with ":" to "To:" So I tried:

var msgHeader = (data.match(/Subject:\s*(.+)\s+To\\:/i))[1];

But this will throw a error. What is the secret to looks from "Subject:" up to "To:"?

ingo
  • 776
  • 1
  • 10
  • 25

0 Answers0