using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"\<div id=\""content\""[.\s\S]*?(?=\<div id=\""footer\"")";
string substitution = @"";
string input = @"hello this is some text I don't want
asdf
asdfasd
ff
<div id=""content"" class=""other"">
i have this other stuff
<div>More stuff</div>
<div id=""footer"">
hello^[^_]*_
asd;flkjasd
f;kas
dfas
df
asdf a2 5<div id=""footer""><div id=""content></div>";
Regex regex = new Regex(pattern);
string result = regex.Replace(input, substitution);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx