Regular Expressions Interview Questions and Answers
Question - 51 : - What are the methods of a regular expression?
Answer - 51 : -
There are 3 different methods for regular expressions are listed below.
- exec() : scans for a matching string and returns the first matched string
- test() : scans for a matching string and returns boolean value false or true.
- toString() : This method returns the string value of a regular expression.