sudheerj / javascript-interview-questions

List of 1000 JavaScript Interview Questions
24.41k stars 6.92k forks source link

Question 155: What are the string methods available in Regular expression #287

Closed subhoghoshX closed 4 months ago

subhoghoshX commented 5 months ago

First of all the question itself is a bit confusing. It sounds like it's asking for String methods that are available in the Regular expression object. Which sounds weird.

Rephrasing it as "What are the String methods that accept Regular expressions?" would be more clear.

The answer is definitely more than the two methods mentioned in the answer. These are search(), replace(), replaceAll(), match(), matchAll() and split().^1

I can send a PR if necessary. Great project btw. Helping me to quickly refresh my JS knowledge.

sudheerj commented 4 months ago

@subhoghoshX Yes, you are right. Can you please raise a PR. Thank you