Substitute the specified text for the parameter
344475
public void replace( String param, String value ) {
        int [] range;
        while ( (range = findTemplate( param )) != null )
            buff.replace( range[0], range[1], value );
    }
237849
def __substituteFromClientStatement(self,match,prevResponse,extraSymbol="",sessionID = "general"):
        
        prev = 0
        startPadding = 1+len(extraSymbol)
        finalResponse = ""
        for m in re.finditer(r'%'+extraSymbol+'[0-9]+', prevResponse):
            start = m.start(0)
            end = m.end(0)     
            num = int(prevResponse[start+startPadding:end])
            finalResponse += prevResponse[prev:start]
            try:finalResponse += self._quote(self._substitute(match.group(num)),sessionID)
            except IndexError as e:pass
            prev = end
        namedGroup = match.groupdict()
        if namedGroup:
            prevResponse = finalResponse + prevResponse[prev:]
            finalResponse = ""
            prev = 0
            for m in re.finditer(r'%'+extraSymbol+'([a-zA-Z_][a-zA-Z_0-9]*)([^a-zA-Z_0-9]|$)', prevResponse):
                start = m.start(1)
                end = m.end(1)
                finalResponse += prevResponse[prev:start]
                try:
                    value = namedGroup[prevResponse[start+startPadding:end]]
                    if value:finalResponse += self._quote(self._substitute(value),sessionID)
                except KeyError as e:pass
                prev = end
        return finalResponse + prevResponse[prev:]
77999
def replaceStrs(s, *args):
    

    """
    if args == (): return s
    mapping = dict((frm, to) for frm, to in args)
    return re.sub("|".join(map(re.escape, mapping.keys())),
                  lambda match:mapping[match.group(0)], s)
196027
def parameter_action(self, text, loc, par):
        """"""
        exshared.setpos(loc, text)
        if DEBUG > 0:
            print("PARAM:",par)
            if DEBUG == 2: self.symtab.display()
            if DEBUG > 2: return
        index = self.symtab.insert_parameter(par.name, par.type)
        self.shared.function_params += 1
        return index
892536
function replace_params(params) {
	return function replace_params_(match, key) {
		if(params && params.hasOwnProperty(key)) {
			var value = params[key];
			delete params[key];
			return value;
		}
		return ':' + key;
	};
}
204377
def transform(self, text):
        """"""
        return re.sub(self.regex, self.repl, text)
443852
public static String substitute(Pattern pattern, String text, I_CmsRegexSubstitution sub) {

        StringBuffer buffer = new StringBuffer();
        Matcher matcher = pattern.matcher(text);
        while (matcher.find()) {
            matcher.appendReplacement(buffer, sub.substituteMatch(text, matcher));
        }
        matcher.appendTail(buffer);
        return buffer.toString();
    }
807492
function(param) {
    return function(el) {
      var text = el.innerText || el.textContent || el.value || '';
      return !!~text.indexOf(param);
    };
  }
1288168
def parameterize(string, separator='-'):
    
    string = transliterate(string)
    # Turn unwanted chars into the separator
    string = re.sub(r"(?i)[^a-z0-9\-_]+", separator, string)
    if separator:
        re_sep = re.escape(separator)
        # No more than one of the separator in a row.
        string = re.sub(r'%s{2,}' % re_sep, separator, string)
        # Remove leading/trailing separator.
        string = re.sub(r"(?i)^{sep}|{sep}$".format(sep=re_sep), '', string)

    return string.lower()
1130541
def p_param_substitution(self, p):
        ''
        p[0] = (p[1], p[3])
        p.set_lineno(0, p.lineno(1))
394823
def substitute_placeholders(inputstring, placeholders):
    
    newst = inputstring.format(link=placeholders.link,
                               filename=placeholders.filename,
                               directory=placeholders.directory,
                               fullpath=placeholders.fullpath,
                               title=placeholders.title,
                               filename_title=placeholders.filename_title,
                               date=placeholders.date_string(),
                               podcasttitle=placeholders.podcasttitle,
                               filename_podcasttitle=
                               placeholders.filename_podcasttitle,
                               name=placeholders.name,
                               subtitle=placeholders.sanitizedsubtitle,
                               entrysummary=placeholders.entrysummary)
    return newst
1156609
def __replace_base_variables(text, req_len, idx):
        
        return text \
            .replace("{i}", str(idx + 1)) \
            .replace("{n}", str(req_len))
245850
def replaceWith(self, param):
        """"""
        i = self.parent().children().index(self)
        # TODO: transfer the children:
        p = self.parent()
        self.parent().removeChild(self)
        p.insertChild(i, param)
        self = param
1228013
public static String replace(String string, String strOldParam, String strNewData)
    {
        if (string == null)
            return null;
        StringBuilder sb = new StringBuilder(string);
        return Utility.replace(sb, strOldParam, strNewData).toString();
    }
270797
function(text) {
        // Each newline cell data is wrapping double quotes in the text and
        // newline characters should be replaced with substitution characters temporarily
        // before spliting the text by newline characters.
        text = clipboardUtil.replaceNewlineToSubchar(text);

        return _.map(text.split(/\r?\n/), function(row) {
            return _.map(row.split('\t'), function(column) {
                column = clipboardUtil.removeDoubleQuotes(column);

                return column.replace(CUSTOM_LF_REGEXP, LF)
                    .replace(CUSTOM_CR_REGEXP, CR);
            });
        });
    }
1077038
public static String substitute(String input, Object model)
    throws MdwException {
        return substitute(input, model, null, false);
    }
1324123
public static function ReplaceNamedParameters ($text, $parameters) {
		//置換元パラメータの可変長対応
		$parameters_set = [$parameters];
		if (func_num_args() > 2) {
			$parameters_set = array_merge($parameters_set, array_slice(func_get_args(), 2));
		}

		//初期オフセット位置
		$offset = 0;

		//先頭文字が'{'の場合だけ実行
		while (($offset = strpos($text, '{', $offset)) !== false) {
			//二文字目が':'では無い場合、スキップする。
			if (substr($text, $offset + 1, 1) !== ':') {
				continue;
			}

			//末尾検出
			$limit = strpos($text, '}', $offset + 2);

			//対となる末尾が無い場合、終了する。
			if ($limit === false) {
				return $text;
			}

			$limit -= $offset;

			//切り出し
			$name = substr($text, $offset + 2, $limit - 2);

			//置換対象文言が見つからない場合、スキップする。
			$replacement = null;
			foreach ($parameters_set as $parameters) {
				if (isset($parameters[$name])) {
					$replacement = $parameters[$name];
					break;
				}
			}
			if ($replacement === null) {
				$offset += 2;
				continue;
			}

			$text = substr($text, 0, $offset) . $replacement . substr($text, $offset + $limit + 1);
		}

		//処理の終了
		return $text;
	}