Multiline C# Regex to match after a blank line?

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.

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: \A. *?

\r? \n\r? \n.

*? ^From:\s*(^\r\n+)$ Make sure you turn the multiline matching option on, however that works, to make ". " match \n.

Thanks. What I needed was to turn on Singleline mode too, and use . *?

Instead of . *. – user10392 Sep 15 '08 at 23:22.

Writing complicated regular expressions for such jobs is a bad idea IMO. It's better to combine several simple queries. For example, first search for "\r\n\r\n" to find the start of the body, then run the simple regex over the body.

This is using a look-behind assertion. Group 1 will give you the "From" line, and group 2 will give you the actual value ("Alex", in your example). (?*(From:\s*(.*?))$.

S{2,}. +?(.+? From:\s(?.

+? )\s)+? The \s{2,} matches at least two whitespace characters, meaning your first From: James won't hit.

Then it's just a matter of looking for the next "From:" and start capturing from there. Use this with RegexOptions. SingleLine and RegexOptions.

ExplicitCapture, this means the outer group won't hit.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions