M
Maya
Hello,
Im trying to retrieve a text between the <body> and </body> tags in an
HTML file using this code:
public string ReadContentsFromPage(string sb)
{
Regex S = new Regex(@"<BODY>(.*)</BODY>",
RegexOptions.Multiline | RegexOptions.IgnoreCase |
RegexOptions.Compiled);
Match m = S.Match(sb);
string contents = m.Groups[1].Value;
return contents;
}
But the above code return nothing, i tried to remove other nested tags
in the <body> </body> tags and it worked, any idea how to modify the
code to return words inside <body> tags execluding other nested tags?
Thanks,
Maya.
Im trying to retrieve a text between the <body> and </body> tags in an
HTML file using this code:
public string ReadContentsFromPage(string sb)
{
Regex S = new Regex(@"<BODY>(.*)</BODY>",
RegexOptions.Multiline | RegexOptions.IgnoreCase |
RegexOptions.Compiled);
Match m = S.Match(sb);
string contents = m.Groups[1].Value;
return contents;
}
But the above code return nothing, i tried to remove other nested tags
in the <body> </body> tags and it worked, any idea how to modify the
code to return words inside <body> tags execluding other nested tags?
Thanks,
Maya.