【问题标题】:Sublime Text - Search and ReplaceSublime Text - 搜索和替换
【发布时间】:2013-10-14 12:35:49
【问题描述】:

在上面的代码中,如何在 name 属性上搜索editEntidadeXXX,然后在 id 属性上插入这个值?

editEntidade(\w)+ 之类的东西会找到名称,但可以在编辑属性上插入该值?

<div class="control-group column-group horizontal-gutters">
    <label class="large-15 small-100 content-right" for="editEntidadeRua">Rua</label> 
    <div class="control large-40 medium-40 small-100">
        <input type="text" id="editEntidade" name="editEntidadeRua" value="<?php echo html_escape($entidadeValues['rua']) ?>">
    </div>
</div>
<div class="control-group column-group horizontal-gutters">
    <label class="large-15 small-100 content-right" for="editEntidadeCodpostal">Código Postal</label> 
    <div class="control large-10 medium-10 small-100">
        <input type="text" id="editEntidade" name="editEntidadeCodpostal" value="<?php echo html_escape($entidadeValues['codpostal']) ?>">
    </div>
</div>

【问题讨论】:

    标签: regex sublimetext2


    【解决方案1】:

    找到什么:

    id="editEntidade"(\s+)name="editEntidade(\w+)"
    

    替换为:

    id="editEntidade$2" name="editEntidade$2"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多