JSFiddle - React, Tailwind, and code Playground
JavaScript
var content ="Looks like you have _err_no_email or _err_no_code provided.\n_err_no_error_code_for_this, so no replacement here.";
var Lang = {
'no_email' : "No email",
'no_code' : "No code"
}
var replaced = content.replace(/_err_([a-z_]+)/gi, function(fullmatch, key) { return Lang[key] ? Lang[key] : fullmatch; });
alert(replaced);