刪除所有的表我在這個HTML文本的模式:記事本++的正則表達式:從HTML文本
<html>
<body>
<font> .... (some data)
</font>
... (some data)
<table class="list" border=1 cellspacing=0 cellpadding=1 rules=groups borderColor=black >
... (table data)
</table>
<font> .... (some data)
</font>
... (some data)
<table class="list" border=1 cellspacing=0 cellpadding=1 rules=groups borderColor=black >
... (table data)
</table>
<font> .... (some data)
</font>
... (some data)
<table class="list" border=1 cellspacing=0 cellpadding=1 rules=groups borderColor=black >
... (table data)
</table>
...
(and the pattern is repeated)
</body>
</html>
我想刪除所有表(及其內容),剩下的。我試着用這樣的:
正則表達式:
(.*)(<table class="list" border=1 cellspacing=0 cellpadding=1 rules=groups borderColor=black >)(.*)(</table>)(.*)
更換
\1\5
但沒有任何反應......我該如何解決呢?
你不應該匹配前後的所有內容 - 只需匹配表格並將其替換爲空字符串即可。不需要捕獲 – Bergi