<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>specify the replacement for a part of a string</i></div>
<br/>
513406
public JcString with(JcString with) {
		JcString ret = new JcString(with, this,
				new FunctionInstance(FUNCTION.String.REPLACE, 3));
		QueryRecorder.recordInvocationConditional(this, "with", ret, QueryRecorder.placeHolder(with));
		return ret;
	}
554897
function colorInit( oldValue ) {
        var color, percentage, colorArgs, colorValue, cssString;
        var balanced = require( 'balanced-match' );

        //
        cssString  = balanced( '(', ')', oldValue );
        colorArgs  = balanced( '(', ')', cssString.body );
        colorValue = balanced( '(', ')', colorArgs.body );

        // If colorValue is undefined, the value is an rbg or similar color.
        if ( undefined !== colorValue ) {
            color      =  colorValue.pre + '( ' + colorValue.body + ' )';
            percentage = colorValue.post;

        } else {
            // The value is an hexadecimal sting or html color
            var hexColor = colorArgs.body.split( ',' );
            color = hexColor[0].trim();

            if (  undefined === hexColor[1] ) {
                percentage = '';
            } else {
                percentage = hexColor[1].trim();
            }
        }

        // Cleans the variable
        if ( percentage ) {
            percentage = percentage.replace( ',', '' ).trim();
            percentage = percentage.replace( '%', '' ) / 100;

        } else {
            // Check if the percentage is undefine or empty and set it to 0
            percentage = '0';
        }

        return colorConvert( percentage, colorArgs.pre, color );
    }
1289929
static String replacePlaceHolder( CssFormatter formatter, String str, LessObject caller ) {
        int pos = str.startsWith( "@{" ) ? 0 : str.indexOf( "@", 1 );
        if( pos >= 0 ) {
            formatter.addOutput();
            SelectorUtils.appendToWithPlaceHolder( formatter, str, pos, false, caller );
            return formatter.releaseOutput();
        }
        return str;
    }
417511
public static String escapeHTML(String s) {
    // this version is much faster than using s.replaceAll()
    StringBuilder sb = new StringBuilder();
    int n = s.length();
    for (int i = 0; i < n; i++) {
      char c = s.charAt(i);
      switch (c) {
        case '<':
          sb.append("&lt;");
          break;
        case '>':
          sb.append("&gt;");
          break;
        case '&':
          sb.append("&amp;");
          break;
        case '"':
          sb.append("&quot;");
          break;
        default:
          sb.append(c);
          break;
      }
    }
    return sb.toString();
  }
932269
static String jsRegExpToJavaRegExp(String re) {
		re = re.replaceAll("\\[\\^\\\\\\d\\]", ".");
		re = re.replaceAll("\\[([^\\]]*)\\\\b([^\\]]*)\\]", "[$1\\\\cH$2]"); // [...\b...]
																				// ->
																				// [...\cH...]
		re = re.replaceAll("(?<!\\\\)\\[([^((?<!\\\\)\\[)\\]]*)\\[", "[$1\\\\["); // [...[...]
																					// ->
																					// [...\[...]

		// back reference in character classes are simply ignored by browsers
		re = re.replaceAll("(?<!\\\\)\\[([^\\]]*)(?<!\\\\)\\\\\\d", "[$1"); // [...ab\5cd...]
																			// ->
																			// [...abcd...]

		// characters escaped without need should be "un-escaped"
		re = re.replaceAll("(?<!\\\\)\\\\([ACE-RT-VX-Zaeg-mpqyz])", "$1");

		re = escapeJSCurly(re);
		return re;
	}
684332
function setStyle(el, strCss) {
        function endsWith(str, suffix) {
            var l = str.length - suffix.length;
            return l >= 0 && str.indexOf(suffix, l) == l;
        }

        var sty = el.style,
            cssText = sty.cssText;
        if (!endsWith(cssText, ';')) {
            cssText += ';';
        }
        sty.cssText = cssText + strCss;
    }
952564
function replaceWithSpacer(style) {
    const lines = style.content.split('\n').length;
    const spacer = new Array(lines).join('\n');
    _.set(style, 'content', spacer);
}
1139165
function(value, element, param) {
			param = typeof param == "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif";
			return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i")); 
		}
78346
public ReplaceWith replace(JcString what) {
		ReplaceWith ret = new ReplaceWith(what, this, OPERATOR.Common.COMMA_SEPARATOR);
		QueryRecorder.recordInvocationConditional(this, "replace", ret, QueryRecorder.placeHolder(what));
		return ret;
	}
1243864
function conditional_replace(html, $) {
  return html.replace(/<!--\[if ([^\]]*)\]>((?:(?!--)[\s\S])*?)<!\[endif\]-->/g, function (match, condition, body) {
    var dd = '<!-- cc:start -->';
    dd += body.replace(/<([A-Za-z:]+)/g, '<!-- cc:bo:$1 --><cc-$1') // before open tag
      .replace(/<\/([A-Za-z:]+)>/g, '<!-- cc:bc:$1 --></cc-$1><!-- cc:ac:$1 -->') // before/after close tag
      .replace(/\/>/g, '/><!-- cc:sc -->'); // self-close tag
    dd += '<!-- cc:end -->';
    var output = '<replacedcc condition="' + condition + '" style="display: none">';
    output += $('<div>').append($(dd)).html()
      .replace(/^<!-- cc:start -->/, '')
      .replace(/<!-- cc:end -->$/, '');
    output += '</replacedcc>';
    return output;
  });
}
1158412
function(code) {

		var tokens = new TokenStream(code),
			hasCRLF = code.indexOf("\r") > -1,
			lines = code.split(/\r?\n/),
			line,
			token,
			tt,
			replacement,
			colAdjust = 0,
			lastLine = 0;

		while ((tt = tokens.get()) !== 0) {
			token = tokens.token();

			if (tt === Tokens.URI) { // URI

				if (lastLine !== token.startLine) {
					colAdjust = 0;
					lastLine = token.startLine;
				}

				replacement = this.replacer(token.value.replace(URL_PARENS, ""));

				// 5 is for url() characters
				line = lines[token.startLine - 1];
				lines[token.startLine - 1] = line.substring(0, token.startCol + colAdjust - 1) +
					"url(" + replacement + ")" + line.substring(token.endCol + colAdjust - 1);
				colAdjust += ((replacement.length + 5) - token.value.length);
			}
		}

		return lines.join(hasCRLF ? "\r\n" : "\n");
	}
165210
@SuppressWarnings({ "unused", "null" })
  public static @NotNull String jcrQueryLiteral(@NotNull String value) {
    if (value == null) {
      throw new IllegalArgumentException("Invalid query string value: " + value);
    }
    return "'" + StringUtils.replace(value, "'", "''") + "'";
  }
756014
function ( target ) {
        var result = {},
            val = String( target );

        if ( val && val.indexOf('(') > -1 ) {
            result = {value: $B.string.trim(val), unit: ''};
        } else {
            val.replace( this.REG_CSS_VALUE, function (str, v, u) {
                result = {value: $B.string.trim(v), unit: u || ''};
            });
        }
        return result;
    }
1080206
public void setString(String string) {
        rawString = string;
        colorIndices.clear();
        // Search for color codes
        final StringBuilder stringBuilder = new StringBuilder(string);
        final Matcher matcher = COLOR_PATTERN.matcher(string);
        int removedCount = 0;
        while (matcher.find()) {
            final int index = matcher.start() - removedCount;
            // Ignore escaped color codes
            if (index > 0 && stringBuilder.charAt(index - 1) == '\\') {
                // Remove the escape character
                stringBuilder.deleteCharAt(index - 1);
                removedCount++;
                continue;
            }
            // Add the color for the index and delete it from the string
            final String colorCode = matcher.group();
            colorIndices.put(index, CausticUtil.fromPackedARGB(Long.decode(colorCode).intValue()));
            final int length = colorCode.length();
            stringBuilder.delete(index, index + length);
            removedCount += length;
        }
        // Color code free string
        this.string = stringBuilder.toString();
    }
280412
function highlight(js) {
  return js
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>')
    .replace(/('.*?')/gm, '<span class="string">$1</span>')
    .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
    .replace(/(\d+)/gm, '<span class="number">$1</span>')
    .replace(
      /\bnew[ \t]+(\w+)/gm,
      '<span class="keyword">new</span> <span class="init">$1</span>'
    )
    .replace(
      /\b(function|new|throw|return|var|if|else)\b/gm,
      '<span class="keyword">$1</span>'
    );
}
1293689
def _replace_options(string, options)
      # Unescape the string so we can use the returned string
      # to set an elements inner html.
      s = string.gsub('&lt;', '<').gsub('&gt;', '>')

      if options
        # But escape option values to prevent code injection
        s.gsub(/%\{(\w+)\}/) do |m|
          key = ($1 || m.tr("%{}", ""))

          if options.key?(key)
            options[key].to_s.gsub('<', '&lt;').gsub('>', '&gt;')
          else
            key
          end
        end
      else
        s
      end
    end
1114574
def colourize(str)
     ''.tap { |res| Tokenizer.tokenize(str.to_s) { |token, value|
        res << colourize_string(value, colours[token])
      } }
    rescue => err
      Brice.error(self, __method__, err)
      str
    end