rem: queryField.value = query.toLowerCase(); 
add: var i = query.indexOf(':'); if(i == -1) { queryField.value = query.toLowerCase(); } else { queryField.value = query.substring(0, i) + query.substring(i).toLowerCase(); } 
context: function doCheckLuceneQuery(queryField){  var query = queryField.value;  if(query != null && query.length > 0)  {    var matches = query.match(/^(\*)|([^a-zA-Z0-9_]\*)/);    // check wildcards are used properly    if(matches != null && matches.length > 0)    {      alert("Invalid search query! The wildcard (*) character must be preceded by at least one alphabet or number. Please try again.")      return false;    }    // check parentheses are used properly    matches = query.match(/^([^\n()]*|(\(([a-zA-Z0-9_+\-:()\" ]|\*)+\)))*$/);    if(matches == null || matches.length == 0)    {      alert("Invalid search query! Parentheses must contain at least one alphabet or number. Please try again.")      return false;    }    // check '+' and '-' are used properly          matches = query.match(/^(([^\n+-]*|[+-]([a-zA-Z0-9_:()]|\*)+))*$/);    if(matches == null || matches.length == 0)    {      alert("Invalid search query! '+' and '-' modifiers must be followed by at least one alphabet or number. Please try again.")      return false;    }              // check that quote marks are closed    matches = query.match(/\"/g);    if(matches != null)    {      var number = matches.length;      if((number % 2) > 0)      {        alert("Invalid search query! Please close all quote (\") marks.");        return false;      }    }        // check ':' is used properly    matches = query.match(/^(([^\n:]*|([a-zA-Z0-9_]|\*)+[:]([a-zA-Z0-9_()"]|\*)+))*$/);    if(matches == null || matches.length == 0)    {      alert("Invalid search query! Field declarations (:) must be preceded by at least one alphabet or number and followed by at least one alphabet or number. Please try again.")      return false;    }        if(wildcardCaseInsensitive)    {      if(query.indexOf("*") != -1)      {        queryField.value = query.toLowerCase();      }    }    return true;  }}
meta: 841	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/841/4d96f7eb97590be4732686c0fce5df9fe5f311ed/luceneQueryValidator.js/buggy/sandbox/contributions/javascript/queryValidator/luceneQueryValidator.js