正则表达式替换几个html属性

Y.G*_*G.J 2 html regex

我有这个HTML:

<table style="width: 128px;" border="0" cellspacing="0" cellpadding="0">
<colgroup span="1"><col span="2" width="64"></col></colgroup>
<tbody>
<tr height="20">
<td width="64" height="20">&nbsp;</td>
<td class="xl65" dir="rtl" width="64"><strong></strong></td>
</tr>
<tr height="20">
<td class="xl67" dir="rtl" width="64" height="20">&nbsp;</td>
<td class="xl66" dir="ltr" width="64">T3500&nbsp;</td>
</tr>
<tr height="20">
<td class="xl68" width="64" height="20">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr height="20">
<td height="20">&nbsp;</td>
<td class="xl65" dir="rtl" width="64"><strong></strong></td>
</tr>
<tr height="48">
<td class="xl67" dir="rtl" width="64" height="48">&nbsp;</td>
<td class="xl66" dir="ltr" width="64">Intel&reg; X58 Chipset&nbsp;</td>
</tr>
<tr height="33">
<td class="xl70" dir="rtl" width="64" height="33">&nbsp;</td>
<td class="xl69" dir="ltr" width="64">10/100/1000&nbsp;</td>
</tr>
<tr height="20">
<td class="xl68" width="64" height="20">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr height="20">
<td height="20">&nbsp;</td>
<td class="xl65" dir="rtl" width="64"><strong></strong></td>
</tr>
<tr height="96">
<td class="xl67" dir="rtl" width="64" height="96">&nbsp;</td>
<td class="xl66" dir="ltr" width="64">One Intel Xeon W3503(2.4GHz,4.8GT/s,4MB,DC)&nbsp;</td>
</tr>
<tr height="20">
<td class="xl68" width="64" height="20">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

我想用任何东西替换所有样式,目录,高度,宽度和类,以便它将被删除

这是我为他们中的一些尝试过的,它在一个在线测试器中工作,但在notepad ++中不起作用

( class=\"([^\"]*)\"){0,} (width=\"([^\"]*)\"){0,} (height=\"([^\"]*)\"){0,}
Run Code Online (Sandbox Code Playgroud)

Tim*_*ker 5

尝试

\s*(?:style|dir|height|width|class)\s*=\s*"[^"]*"\s*
Run Code Online (Sandbox Code Playgroud)

当然,这将删除文本,style="hello"无论它们出现在何处,也可以在标签之外.

可能是Notepad ++不支持\s简写.尝试使用

[ ]*(?:style|dir|height|width|class) *= *"[^"]*" *
Run Code Online (Sandbox Code Playgroud)

相反,看看是否有效.在[ ]一开始可以用一个空格来代替.