JavaScript | Regular Expressions JSON | Question 8

Last Updated :
Discuss
Comments

What is the purpose of the search() method in strings?

Returns an array of matches

Finds the index of the first match

Validates a regular expression pattern

Replaces the first match with a new string

Share your thoughts in the comments