+ - && || ! ( ) { } [ ] ^ " ~ * ? : \
760719
def escapeQueryTerm(self, term):
        
        reserved = [
            '+',
            '-',
            '&',
            '|',
            '!',
            '(',
            ')',
            '{',
            '}',
            '[',
            ']',
            '^',
            '"',
            '~',
            '*',
            '?',
            ':',
        ]
        term = term.replace('\\', '\\\\')
        for c in reserved:
            term = term.replace(c, "\%s" % c)
        return term
1076329
function where (expr, operator) {
    if (this.typecheck) t.typecheck('where', [expr, operator]);
    if ('string'===typeof expr) return 'where '+expr;
    return 'where ' + expr.join(' '+(operator||'and')+' ');
}
168499
function isExpression(exp) {
  if (exp && typeof exp === 'object' && !_.isArray(exp)) {
    // 对象
    var keys = _.keys(exp);
    if (
      keys.length &&
      _.every(keys, function (key) {
        return key && key[0] === '$';
      })
    ) {
      // 表达式对象
      return true;
    }
  }
  return false;
}
1093527
function verifyMathExpressions(expression, node) {
        if (expression.type === "MathExpression") {
          const { operator, left, right } = expression;

          if (operator === "+" || operator === "-") {
            if (
              expression.source.operator.end.index === right.source.start.index
            ) {
              complain(
                messages.expectedSpaceAfterOperator(operator),
                node.sourceIndex + expression.source.operator.end.index
              );
            }

            if (
              expression.source.operator.start.index === left.source.end.index
            ) {
              complain(
                messages.expectedSpaceBeforeOperator(operator),
                node.sourceIndex + expression.source.operator.start.index
              );
            }
          } else if (operator === "/") {
            if (
              (right.type === "Value" && right.value === 0) ||
              (right.type === "MathExpression" && getNumber(right) === 0)
            ) {
              complain(
                messages.rejectedDivisionByZero(),
                node.sourceIndex + expression.source.operator.end.index
              );
            }
          }

          if (getResolvedType(expression) === "invalid") {
            complain(
              messages.expectedValidResolvedType(operator),
              node.sourceIndex + expression.source.operator.start.index
            );
          }

          verifyMathExpressions(expression.left, node);
          verifyMathExpressions(expression.right, node);
        }
      }
73072
function isEqualRegexp(a, b) {
  if (typeOf(a) !== 'regexp') return false;
  if (typeOf(b) !== 'regexp') return false;
  if (a.source !== b.source) return false;
  if (a.global !== b.global) return false;
  if (a.multiline !== b.multiline) return false;
  if (a.ignoreCase !== b.ignoreCase) return false;
  return true;
}
991777
function ( text ){
		   var out = [text],
			   chars = ['-','+','z','Z'],
			   i = chars.length;

			while (i--) {
			  if(text.indexOf(chars[i]) > -1){
				  out[0] = text.slice( 0, text.indexOf(chars[i]) );
				  out.push( text.slice( text.indexOf(chars[i]) ) );
				  break;
			   }
			}
		   return out;
		}
179079
function encodeEntities(value) {
  return value.
    replace(/&/g, '&amp;').
    replace(NON_ALPHANUMERIC_REGEXP, function(value){
      return '&#' + value.charCodeAt(0) + ';';
    }).
    replace(/</g, '&lt;').
    replace(/>/g, '&gt;');
}
990328
function(inText) {
			return !enyo.isString(inText) ? inText : String(inText).replace(/&/g,'&amp;').replace(/\"/g,'&quot;');
		}
411720
function restoreExpr(html, pcex) {
  if (pcex.length) {
    html = html
      .replace(/\u0001(\d+)/g, function (_, d) {
        var expr = pcex[d]
        if (expr[0] === '=') {
          expr = expr.replace(brackets.R_STRINGS, function (qs) {
            return qs //.replace(/&/g, '&amp;') // I don't know if this make sense
              .replace(/</g, '&lt;')
              .replace(/>/g, '&gt;')
          })
        }
        return pcex._bp[0] + expr.replace(/"/g, '\u2057')
      })
  }
  return html
}
325442
function(string) {
    return string.replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/\//g,'&#x2F;');
  }
854057
Expr and() {
		Expr expr = equalNotEqual();
		for (Tok tok=peek(); tok.sym==Sym.AND; tok=peek()) {
			move();
			expr = new Logic(Sym.AND, expr, equalNotEqual(), location);
		}
		return expr;
	}
1353374
def htmlsafe(unsafe):
    
    unsafe = unsafe.replace('&', '&amp;')
    unsafe = unsafe.replace('<', '&lt;')
    unsafe = unsafe.replace('>', '&gt;')
    return unsafe
104947
static public BooleanExpression AND(BooleanExpression... operands){
		BooleanExpression result = new BooleanExpression(OPERATOR_AND);
		result.addOperand(operands);
		return result;
	}
538779
function(v1, v2, e1, e2) {
        return !((e1 < v1 && e2 < v1) || (e1 > v2 && e2 > v2));
    }
227461
function() {
        return "| " + this.matrix[0][0] + " " + this.matrix[0][1] + " " + this.matrix[0][2] + " " + this.matrix[0][3] + " |\n" + "| " + this.matrix[1][0] + " " + this.matrix[1][1] + " " + this.matrix[1][2] + " " + this.matrix[1][3] + " |\n" + "| " + this.matrix[2][0] + " " + this.matrix[2][1] + " " + this.matrix[2][2] + " " + this.matrix[2][3] + " |\n" + "| " + this.matrix[3][0] + " " + this.matrix[3][1] + " " + this.matrix[3][2] + " " + this.matrix[3][3] + " |";
    }
689245
private void escape(StringBuilder sb, String text) {
        if (text == null) {
            text = "<null>";
        }
        for (int i = 0; i < text.length(); i++) {
            char ch = text.charAt(i);
            if (ch == '<') {
                sb.append("&lt;");
            } else if (ch == '>') {
                sb.append("&gt;");
            } else if (ch == '&') {
                sb.append("&amp;");
            } else {
                sb.append(ch);
            }
        }
    }
611149
function __match(regexp) {
  return function(ch) { 
  	return !!(ch !== DONE && (ch === undefined || ch.match(regexp)))? MATCH_TRUE: MATCH_FALSE };
}