Copy-paste multiple values to their placeholders notepad++

122 views Asked by At

Suppose markup (many lines with same structure)

<a href="">xxx</a>
<a href="">yyy</a>
<a href="">zzz</a>

What is the best way to achive this? (copy-paste into href="")

<a href="xxx">xxx</a>
<a href="yyy">yyy</a>
<a href="zzz">zzz</a>

My thoughts: execute JS then copy html from browser, but seems a bit cumbersome. Any notepad++ solution?

$('a').each(function(){
    $(this).attr('href',$(this).text());
});
1

There are 1 answers

1
Tim Biegeleisen On BEST ANSWER

You could do the following replacement in regex mode:

Find:    <a href="">(.*?)</a>
Replace: <a href="$1">$1</a>

Here is a working regex demo.