const regex = /<h(?:[\d]{1})(?:.*?)>(.*?)<\/h(?:[\d]{1})>/g;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('<h(?:[\\d]{1})(?:.*?)>(.*?)<\\\/h(?:[\\d]{1})>', 'g')
const str = `<h1 class="text-align-center" style="font-size:22px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-family:IntroBold, sans-serif;line-height:1.5;letter-spacing:0px;font-weight:700;text-align:center;">You should be confident solving wicked problems in a hybrid role between strategy, research, design and business through a discovery driven approach. </h1><p></p><h2 style="margin-top:0px;margin-bottom:.5em;font-family:IntroBold, sans-serif;font-size:19px;line-height:1em;text-transform:uppercase;letter-spacing:1px;font-weight:700;"><strong>KEY RESPONSIBILITIES</strong></h2>`;
const subst = `<strong>$1</strong>`;
// The substituted value will be contained in the result variable
const result = str.replace(regex, subst);
console.log('Substitution result: ', result);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions