JavaScript regular expressions methods
In the following table, you can find the methods used to match or test a regular expression. The main JavaScript objects used in regular expressions are String and RegExp, which represent a pattern (such as regular expression).
| 
 Method  | 
 Description  | 
 Example  | 
|---|---|---|
| 
 
  | 
 This executes a search for a match within a string, based on a regular expression.  | 
 
 
 
  | 
| 
 
  | 
 This executes a search for a match in its string parameter. Unlike   | 
 
 
 
  | 
| 
 
  | 
 This searches and replaces the regular expression portion (match) with the replaced text instead.  | 
 
  |