我有以下文字
obart on 18 September 1905. <h4>(^)</h4>Always known as Jack, he had been in the islands arrived in Rabaul on SS <h4> </h4><i> Montoro</i> to begin a caver, and d="k987" /><a id="k988" /><a id="k989" /><a id="k990" /></p><h4 style="text-align:left;">URGENT – TERRITORY OF NEW GUINEA</h4><br /><div class="quotation">In view of the broadcast that proceed with all speed to Kieta, bringing clothing and bedding. Rations will be provided. <br /></div><div clas:black;size:1px" /><h4 style="text-align:left;"></h4></div></body></html><h4></h4>
它有fife h4标题我想捕捉那些里面没有任何东西或者里面有空格的人,有人可以帮我吗? 我试过这个
(<h4.*?>)([^a-zA-Z0-9]+?)</h4>
但它看不到工作
答案 0 :(得分:1)
虽然我同意eykanal认为更好的解决方案是DOM的一些解决方案,但是匹配标签的Regex没有任何内容或只有空格应该像...一样简单。
<h4.*?>\\s*?</h4>
NB。我不熟悉在C#中编写正则表达式模式,但我认为这应该是正确的。
答案 1 :(得分:0)