Suppose I have the following string:
string input = \"Hello world\\n\" +
\"Hello foobar world\\n\" +
\"Hello foo world\\n\";
Yes, this is possible. You can use the following:
Regex.Matches(input, @".*(YourSuppliedRegexHere).*");
This works because the . character matches anything but the newline (\n) chracter.
Surround your regex phrase with .* and .* so that it pick up the entire line.
string pattern = ".*foobar.*";
Regex r = new Regex(pattern)
foreach (Match m in r.Matches(input))
{
Console.WriteLine(m.Value);
}