`String.prototype.replace` method https://tc39.github.io/ecma262/#sec-string.prototype.replace
9324
function replace(searchValue, replaceValue) {
      var O = defined(this);
      var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
      return fn !== undefined
        ? fn.call(searchValue, O, replaceValue)
        : $replace.call(String(O), searchValue, replaceValue);
    }
757656
function replacePlaceholder(str, value, _state) {
	if (typeof str === 'string') {
		const ranges = findUnescapedTokens(str, placeholder);
		if (ranges.length) {
			if (_state) {
				_state.replaced = true;
			}

			str = replaceRanges(str, ranges, value);
		}
	}

	return str;
}
1147595
def replace_symbol(text, replacement_text="", is_replace_consecutive_chars=False, is_strip=False):
    

    try:
        new_text = __RE_SYMBOL.sub(replacement_text, preprocess(text))
    except (TypeError, AttributeError):
        raise TypeError("text must be a string")

    if not replacement_text:
        return new_text

    if is_replace_consecutive_chars:
        new_text = re.sub("{}+".format(re.escape(replacement_text)), replacement_text, new_text)

    if is_strip:
        new_text = new_text.strip(replacement_text)

    return new_text
1058816
function replaceSpecialChars(item) {
	if (!j79.isString(item)) {
		return item;
	}

	var result = item;

	var specialChars = Object.keys(SPECIAL_CHARS_MAP);
	for (var index in specialChars) {
		result = replaceSpecialChar(result, specialChars[index]);
	}

	return result;
}
596780
function replace(searchValue, replaceValue) {
        var O = requireObjectCoercible(this);
        var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
        return replacer !== undefined
          ? replacer.call(searchValue, O, replaceValue)
          : nativeReplace.call(String(O), searchValue, replaceValue);
      }
1375006
public String replace(String str, String regex, String replace) {
		if (str == null)
			return "";
		if (regex == null)
			return str;
		if(replace == null) replace = "";
		return str.replaceAll(regex, replace);
	}
804698
def replace_first(input, string, replacement = ''.freeze)
      input.to_s.sub(string.to_s, replacement.to_s)
    end
419410
function(str) {
            var f = this.filter;
            return (f) ?  str.replace(new RegExp(f.searchExp, 'g'), f.replaceStr) : str;
        }
1174002
function replacer(key, value) {
  if (value instanceof Buffer)
    return value.toString('base64');
  // eslint-disable-next-line valid-typeof
  if (typeof value === 'bigint')
    return value.toString();
  return value;
}
1230701
function replace(pattern, replacement, val){
  utils.assertString(pattern, 'pattern');
  utils.assertString(replacement, 'replacement');
  utils.assertString(val, 'val');
  pattern = new RegExp(pattern.string, 'g');
  var res = val.string.replace(pattern, replacement.string);
  return val instanceof nodes.Ident
    ? new nodes.Ident(res)
    : new nodes.String(res);
}
212106
public final String replaceExpr(
        String message,
        String type
    ) {
        message = decode(message);

        List mapFilter = getFilter(type);

        if (mapFilter == null)
            return message;

        Iterator it = mapFilter.iterator();

        while (it.hasNext()) {
            Object value[] = (Object[]) it.next();
            String replacement = (String) value[0];
            List vFilter = (List) value[1];

            if ((vFilter.size() == 0) && (replacement.equals("[VALIDATE]"))) {
                message = validate(
                        message,
                        type
                    );

                continue;
            }

            for (int j = 0; j < vFilter.size(); j++) {
                Pattern filter = (Pattern) vFilter.get(j);
                Matcher match = filter.matcher(message);

                while (match.find()) {
                    message = match.replaceAll(replacement);
                    match = filter.matcher(message);
                }
            }
        }

        return message;
    }
323918
function attemptReplace(token, pattern, replacement, callback) {
    var result = null;
    
    if((typeof pattern == 'string') && token.substr(0 - pattern.length) == pattern)
        result = token.replace(new RegExp(pattern + '$'), replacement);
    else if((pattern instanceof RegExp) && token.match(pattern))
        result = token.replace(pattern, replacement);
        
    if(result && callback)
        return callback(result);
    else
        return result;
}
1034893
async function replace(string, regex, callback) {
	regex.lastIndex = 0;

	/* get all data */
	const promises = [];
	string.replace(regex, (match, ...args) => {
		const promise = callback(match, ...args);
		promises.push(promise);
	});
	const data = await Promise.all(promises);

	/* replace all data */
	return data.length ? string.replace(regex, () => data.shift()) : string;
}
479318
function(a){var b;
// the final two arguments are the length, and the entire string itself;
// we don't care about those.
if(arguments.length<7)throw new Error("markup() must be called from String.prototype.replace()");return b=e.apply(null,arguments),'<span class="'+d[b]+'">'+a+"</span>"}
541419
function (stringToStrip) {
            var s = stringToStrip;
            s = s.replace(/[\u00E0\u00E2\u00E4]/gi, "a");
            s = s.replace(/[\u00E9\u00E8\u00EA\u00EB]/gi, "e");
            s = s.replace(/[\u00EE\u00EF]/gi, "i");
            s = s.replace(/[\u00F4\u00F6]/gi, "o");
            s = s.replace(/[\u00F9\u00FB\u00FC]/gi, "u");
            return s;
        }
991409
function replaceInString(string, variables) {
    const model = createModel(string);
    let offset = 0;
    let output = '';

    for (let i = 0, il = model.variables.length; i < il; i++) {
        const v = model.variables[i];
        let value = v.name in variables ? variables[v.name] : v.name;
        if (typeof value === 'function') {
            value = value(model.string, v, offset + v.location);
        }

        output += model.string.slice(offset, v.location) + value;
        offset = v.location + v.length;
    }

    return output + model.string.slice(offset);
}
423247
function(str) {
      var SNAKE_CASE_REGEXP = /[A-Z]/g;
      return str.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
        return (pos ? '-' : '') + letter.toLowerCase();
      });
    }