Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SublimeText 2 / REGEX - Remove everything in between two tags including line breaks?

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>
like image 859
Devin Avatar asked May 23 '13 15:05

Devin


1 Answers

Got it. SublimeText has special tags for REGEX apparently.

(?s)<table(.*?)</table>
like image 148
Devin Avatar answered Nov 18 '22 13:11

Devin