I'm looking to remove certain style attributes from table tags only. So I might have a messy string like this:
<table border="0" width="641" style="width:480.95pt;margin-left:4.65pt;border-collapse:collapse;mso-padding-alt:0in 5.4pt 0in 5.4pt">
<tbody><tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes;height:23.25pt">
<td width="299" nowrap="" colspan="3" valign="top" style="width:224.45pt;border-top:
solid windowtext 1.0pt;border-left:solid windowtext 1.0pt;border-bottom:none;
border-right:solid black 1.0pt;mso-border-top-alt:solid windowtext .5pt;
mso-border-left-alt:solid windowtext .5pt;mso-border-right-alt:solid black .5pt;
background:#538ED5;padding:0in 5.4pt 0in 5.4pt;height:23.25pt">
And I need the regex to match width:XXXpt;
. I tried with this and many variations and it doesn't work:
^<table.*(width:\wpt;?)\/table>$
An explanation would be greatly appreciated as I'm learning regex.