SublimeText 2 / REGEX - Remove everything in betwe

2019-02-17 04:10发布

问题:

I have a CSV document littered with thousands of instances of a table that I need to remove. I assume I can use REGEX, but I can't seem to find an expression to remove it. I attached a sample at the bottom.

I thought <table(.*)</table> would work, but that seems to ignore line breaks. Is there somebody who can help me remove these?

<table cellpadding=""5"" align=""center"" class=""shippingcost"" style=""width: 525px;"">

 <tbody>

 <tr>

 <td colspan=""2"" style=""text-align: center;"">Shipping:

 </td>

 </tr>

 <tr class=""shippingcostrow"">

 <td>

 <div align=""right"">Domestic

 Canada

 International

 </td>

 <td width=""400"">

 <div align=""left"">Insured shipping is included to all U.S. destinations.

 Canadian buyers pay $28 for EMS insured shipping.

 All International Buyers pay $35 for EMS insured shipping.

 </td>

 </tr>

 </tbody>

</table>

回答1:

Got it. SublimeText has special tags for REGEX apparently.

(?s)<table(.*?)</table>