This method returns a string and not a String object. Examples Example 1. If you want to get the actual letter, number, or symbol of the key, you can use fromCharCode . The following example returns the letter, number, or symbol of the KeyPress event's which property. Used to match a regular expression against a string.
Parameters string is any string.
It can be a variable name or a literal. These can be included separately or together. The following two examples below show how to use these flags with match . If you are executing a match simply to find true or false , use search or the regular expression test method. In the following example, match is used to find 'Chapter' followed by one or more numeric characters followed by a decimal point and numeric character zero or more times.