string str = File.ReadAllText(@"F:txt.txt", Encoding.GetEncoding("gb2312"));//换成你的字符串
Regex reg = new Regex(@"(?is)(?<=<divs*id=""bookBrief""s*>)s*<h1[^>]*?>((?:(?!</?h1).)*)</h1>.*?<p[^>]*?>((?:(?!</?p).)*).*?splitAuthor(['""]([^'""]+)['""])");
Match m = reg.Match(str);
Console.WriteLine(m.Groups教程[1].Value);
Console.WriteLine(m.Groups[2].Value);
Console.WriteLine(m.Groups[3].Value);
Console.ReadLine();
/*
“贾志刚《说春秋》之二:秦晋恩怨”
“齐楚争雄,桓公野心高涨,楚王枕戈待旦,南北战争,箭在弦上,一触即发……晋室血雨腥风,勾心斗角,摇摇欲坠;大秦崛起边陲,倾慕中原,与晋联姻,道不清恩恩怨怨……公子重耳十九载颠沛流离,幸得非凡团队忠心不贰,走南闯北,忍辱负重,终至王者归来……”
贾志刚
*/
时间: 2024-09-22 19:38:47