| ignoreCase The igtnoreCase property is a property of the RegExp object, and is used to inform the script as to whether or not the case of the searched string is to ignored. For a detailed explanation of the RegExp object and its uses, see the JavaScript Object Reference, RegExp. syntax: syntax example EXAMPLE regExpSearch = new RegExp("this, T"); stringToSearch = "This is the input to be displayed"; regExpArray = regExpSearch.exec(stringToSearch); document.write("The ignore case returns the following : " + regExpSearch.ignoreCase); The example first starts with the creation of a new RegExp object, called regExpSearch. The search is for the letters "th", and "T". Next created is the string to search through, called stringToSearch. Next comes another variable which contains the RegExp expression (regExpSearch) and the exec() method, which performs the actual execution of the search. Contained as a condition within the exec() method is the variable representing the string to be searched, stringToSearch. Finally a document.write statement is declared, which uses the ignoreCase property of the RegExp object to return the text string, "The ignore case returns the following : ", which is represented by the "stringToSearch" variable. The returned value looks like the following: The ignore case returns the following : false |