输入是:
<p>1:4 And David said unto him, How went the matter? I pray thee, tell me.</p>
<p>And he answered, That the people are fled from the battle, and many of the people also are fallen and dead; and Saul and Jonathan his son are dead also.</p>
第一行包含数字 (1:4),第二行仅包含字符串。
我只想在<p>
标签中查找字符串并将该内容合并到<p>
html 文件中的前一个标签。
方法:
1:4 And David said unto him, How went the matter? I pray thee, tell me. And he answered, That the people are fled from the battle, and many of the people also are fallen and dead; and Saul and Jonathan his son are dead also.
我可以这样做:
Regex.IsMatch(html, @"^[a-zA-Z]+$");
我怎样才能做到这一点?