JSFiddle - React, Tailwind, and code Playground
HTML
<textarea name="" id="text" cols="30" rows="10"></textarea>
<p>[copy] this and paste { it } on the textarea</p>
JavaScript
$('#text').on('keyup paste',function(){
oldtxt = $(this).val();
find = '(\<?)(\>?)(\\[?)(\\]?)';
newtxt = oldtxt.replace(new RegExp(find, 'g'), '');
$(this).val(newtxt);
});