I’m looking for a multiline regex that will match occurrences after a blank line. For example, given a sample email below, I’d like to match ‘From: Alex’. ^From:\s*(.*)$ works to match any From line, but I want it to be restricted to lines in the body (anything after the first blank line).
Received: from a server Date: today To: Ted From: James Subject: [fwd: hi] fyi ----- Forwarded Message ----- To: James From: Alex Subject: hi Party!
I’m not sure of the syntax of C# regular expressions but you should have a way to anchor to the beginning of the string (not the beginning of the line such as ^). I’ll call that ‘\A’ in my example:
Make sure you turn the multiline matching option on, however that works, to make ‘.’ match \n