If you run this:
string result = "<html><hea d></head><body>The body</body></html>";
result = retainBody.Repl ace(result, "$1");
With the following Regex:
private static readonly Regex retainBody = new
Regex(@"<\s*bod y[^>]*>(.*)<[\s/]*body[^>]*>", RegexOptions.Co mpiled |
RegexOptions.Ig noreCase | RegexOptions.Si ngleline);
You get this as the return:
<html><head></head>The body</html>
I want this instead:
The body
string result = "<html><hea d></head><body>The body</body></html>";
result = retainBody.Repl ace(result, "$1");
With the following Regex:
private static readonly Regex retainBody = new
Regex(@"<\s*bod y[^>]*>(.*)<[\s/]*body[^>]*>", RegexOptions.Co mpiled |
RegexOptions.Ig noreCase | RegexOptions.Si ngleline);
You get this as the return:
<html><head></head>The body</html>
I want this instead:
The body
Comment