dist/string/operators.js
/** Replace all instances in a string that match a given string or regular expression */
Replace all instances in a string that match a given string or regular expression
Replace all instances in a string that match a given string or regular expression
function replace(target, replaceWith) {
    function escapeRegExp(str) {
        return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); 
    }
    return target instanceof RegExp
        ? value => value.replace(target, replaceWith)
        : replace(new RegExp(escapeRegExp(target), "g"), replaceWith);
}
function replace ( target , replaceWith ) { function escapeRegExp ( str ) { return str . replace ( / [.*+?^${}()|[\]\\] / g , "\\$&" ) ; } return target instanceof RegExp ? value => value . replace ( target , replaceWith ) : replace ( new RegExp ( escapeRegExp ( target ) , "g" ) , replaceWith ) ; }
Replace all instances in a string that match a given string or regular expression
Replace all instances in a string that match a given string or regular expression
// $& means the whole matched string
