Skip to content

Instantly share code, notes, and snippets.

View edilsonborges's full-sized avatar
🚀

Edilson Borges edilsonborges

🚀
  • Agrodefesa
  • Goiânia - Goiás - Brazil
  • 16:45 (UTC -03:00)
View GitHub Profile
const regex = /([$][a-z]*)[_]([a-z])([a-z]*)/g;
const str = `\$bo_ativo`;
const subst = `$1\U$2\E$3`;
// The substituted value will be contained in the result variable
const result = str.replace(regex, subst);
console.log('Substitution result: ', result);