string.search( A )
Parameters: This method accepts single parameter A which holds the regular expression as object.
Return Value: This function returns the index of the first match string in between regular expression and the given string object and returns -1 if no match found. Indexing starts from zero (0) and in a first attempt, an alphabet is matched, then it does not check further simply it returns the index of that first matched alphabet.
0 1 4
Example 2: This example returns -1, because of no match found in between regular expression and the input string.
-1 -1 -1 -1