我试图从HTML标签提取字符串
<title>what i want</title>
我知道还有其他的回答或者simiral甚至相同的问题,但似乎对这些问题的答案没有对我的工作的字符串。我当前的代码是
String html = wc.DownloadString("URL");
Match m = Regex.Match(html, "<title>(.*)</title>", RegexOptions.Singleline);
MessageBox(m.Value);
此输出,我已经使用来自不同的答案其他regural表达式,得到了相同的结果 我也不太熟悉
<title>what i want</title>
不
what i want
注用管理表达式,所以这可能是一个noob问题。
您需要一个HTML解析器。 – SLaks
对不起,它的C#只是编辑 – harambe
可能dupe:https://stackoverflow.com/questions/17298353/how-can-i-extract-a-string-between-strong-tags-usings-c – sniperd