| input The input property is a property of the RegExp object, and is used to represent the string on which the pattern is to be matched by the RegExp object. For a detailed explanation of the RegExp object and its uses, see the JavaScript Object Reference, RegExp. The syntrax and example below explain the use of this property better than can words. that is, it's more a concept than words. syntax: RegExp.Input EXAMPLE regExpSearch = new RegExp("th"); stringToSearch = "This is the input to be displayed."; regExpArray = regExpSearch.exec(stringToSearch); document.write(RegExp.input); The example first starts with the creation of a new RegExp object, called regExpSearch. The search is for the letters "th". 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 input property of the RegExp object to return the text string, "This is the input to be displayed.", which is represented by the "stringToSearch" variable. The returned value looks like the following: This is the input to be displayed. |