SublimeText 2/REGEX - 删除两个标签之间的所有内容,包括换行符? [英] SublimeText 2 / REGEX - Remove everything in between two tags including line breaks?

查看:43
本文介绍了SublimeText 2/REGEX - 删除两个标签之间的所有内容,包括换行符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 CSV 文档,里面散落着我需要删除的表的数千个实例.我假设我可以使用 REGEX,但我似乎无法找到一个表达式来删除它.我在底部附上了一个样本.

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.

我认为 <table(.*)</table> 会起作用,但这似乎忽略了换行符.有人可以帮我删除这些吗?

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>

推荐答案

明白了.SublimeText 显然有 REGEX 的特殊标签.

Got it. SublimeText has special tags for REGEX apparently.

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

这篇关于SublimeText 2/REGEX - 删除两个标签之间的所有内容,包括换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆