I want to remove the tags and make the selected text between the tags to upper, don't know how?
var pattern = 'We are <orgcase>liViNg</orgcase> in a <upcase>yellow submarine</upcase>.'
var myRegexp = /<upcase>(.*?)<\/upcase>/g;
var match = "$1";
var str = pattern.replace(myRegexp, match.toUpperCase());
console.log(str);
var str = pattern.replace(myRegexp, (m, m1) => m1.toUpperCase());See fiddle.m1is corresponding to(.*?)first capture group.