The wording of your question seems a bit unclear, but it looks like you want RegexOptions.Multiline (in the System.Text.RegularExpressions namespace). This is an option that you should install on your RegEx object. This should make ^ and $ match the beginning and end of the line, not the entire line.
For instance:
Regex re = new Regex("^(.+)$", RegexOptions.Compiled | RegexOptions.Multiline);
source share