Parameters: Here parameter “A” is a regular expression object.
Return Value: This function returns the index of the first match in between regular expression and the given string object and returns -1 if no match found.
Indexing starts from zero (0) and if at first attempt a alphabet is match, then it do not check further simply it return the index of that first matched alphabet.
0 1 4
Here in below code it can be seen that this function is only returning -1, because no matching found in between regular expression and input string.
-1 -1 -1 -1
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.