【问题标题】:How to find multiline attributes using Sublime Text如何使用 Sublime Text 查找多行属性
【发布时间】:2021-02-17 00:13:39
【问题描述】:

我一直在使用style='(.*?)(在查找框中)替换整个样式属性:

例子:

<a style='width: 68px';text-align:center'> < /a>

如何找到多行样式?

例子:

<a style='width: 68px';text-align:center;
 padding:0cm 3.5pt 0cm 3.5pt;height:90.0pt'> < /a>

注意:原文代码来自office word(table) export(这就是为什么多行属性)

【问题讨论】:

    标签: html sublimetext3 sublimetext


    【解决方案1】:

    使用这个正则表达式:

    style='((.|\n)*?)'
    

    唯一的区别是. 被替换为(.|\n) 匹配. 或换行符\n。如果您使用\r\n 作为行尾序列,则需要使用该序列而不是\n

    Demo on regex101.com.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-14
      • 1970-01-01
      • 2012-11-14
      • 1970-01-01
      • 2017-01-26
      • 1970-01-01
      相关资源
      最近更新 更多