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. The regular expression includes the i flag so that case will be ignored. The following example demonstrates the use of the global and ignore case flags with match . Used to find a match between a regular expression and a string, and to replace the matched substring with a new substring.
Parameters string is a 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 replace . The following script switches the words in the string. Executes the search for a match between a regular expression and a specified string.