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.
Parameters string is any string.
It can be a variable name or a literal. If successful, search returns the index of the regular expression inside the string. Otherwise, it returns -1. The following example prints a message which depends on the success of the test. Extracts a section of an string and returns a new string.