metRo_
metRo_

Reputation: 443

Sublime Text - Search and Replace

In the code above how can I search for editEntidadeXXX on the name attribute and then insert this value on the id attribute?

Something like editEntidade(\w)+ will found the names but it is possible to insert that values on the edit attribute?

<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>

Upvotes: 1

Views: 176

Answers (1)

messivanio
messivanio

Reputation: 2311

Find What:

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

Replace With:

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

Upvotes: 1

Related Questions