const regex = /\s*(fill|stroke)="(.*?)"/gm;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('\\s*(fill|stroke)="(.*?)"', 'gm')
const str = `<svg fill="none" height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><g stroke="#2a5ee4" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m6.66675 8.66673c.2863.38275.65157.69945 1.07103.92862s.88331.36545 1.36007.3996.95525-.03465 1.40315-.2017c.4478-.16706.8545-.42848 1.1924-.76652l2-2c.6072-.62868.9432-1.47069.9356-2.34468-.0076-.87398-.3582-1.71003-.9762-2.32805-.618-.61803-1.4541-.96859-2.328-.97619-.874-.00759-1.71604.32839-2.34472.93558l-1.14667 1.14"/><path d="m9.33322 7.33332c-.2863-.38275-.65157-.69945-1.07103-.92863-.41946-.22917-.88331-.36545-1.36007-.39959-.47676-.03415-.95529.03464-1.40313.2017s-.85451.42847-1.19243.76652l-2 2c-.6072.62867-.94318 1.47068-.93558 2.34468.00759.874.35815 1.71.97618 2.328.61803.6181 1.45407.9686 2.32806.9762s1.71599-.3284 2.34467-.9355l1.14-1.14"/></g></svg>`;
const subst = ``;
// 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