Solution 1, simplistic
Match:
<table\b(?![^>]*?\scellspacing\b)([^>]*)>
Replace:
<table cellspacing="0"\1>
Solution 2, more reliable
Match:
<table\b(?!(?:[^>"']|"[^"]*"|'[^']*')*?\scellspacing\b)((?:[^>"']|"[^"]*"|'[^']*')*)>
Replace:
<table cellspacing="0"\1>
Python 正则表达式为XML中tags增加Attribute
最新推荐文章于 2021-01-28 23:34:46 发布