Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading