I am designing an experimental system where when clicking a button it copies what is selected (in this case an excerpt in html) like the one below:
<section>
<h1> titulo </h1>
<p>texto desta área</p>
</section>
<button>Modificar código</button>
Next it would make a change in the code inserting the tags that need to be inserted (for my need)
[[bloco]]
[[repetir]]
<section>
<h1> titulo </h1>
<p>texto desta área</p>
</section>
[[/repetir]]
[[/bloco}}
Will I need to use regex? Is there any way to do this just by copying the contents, changing and pasting without needing to use regex?