function replaceEach(str, replacements, regex_params){
    forOwn(replacements, function(to_replace, replacement){
        var regex = new RegExp(to_replace, regex_params||'g');
        str = str.replace(regex, replacement)
    });
    return str;
}
// replace items in 'str' with 'replacements' object map
replace items in 'str' with 'replacements' object map
replace items in ' str ' with ' replacements ' object map
function replaceEach(str, replacements, regex_params){
    forOwn(replacements, function(to_replace, replacement){
        var regex = new RegExp(to_replace, regex_params||'g');
        str = str.replace(regex, replacement)
    });
    return str;
}
function replaceEach ( str , replacements , regex_params ) { forOwn ( replacements , function ( to_replace , replacement ) { var regex = new RegExp ( to_replace , regex_params || 'g' ) ; str = str . replace ( regex , replacement ) } ) ; return str ; }
replace items in 'str' with 'replacements' object map
replace items in ' str ' with ' replacements ' object map