'Copy-paste multiple values to their placeholders notepad++
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());
});
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tim Biegeleisen |
