)
    7. [ ` Object.prototype.propertyIsEnumerable() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable)
    8. [ ` Object.prototype.toLocaleString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toLocaleString)
    9. [ ` Object.prototype.toString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString)
    10. [ ` Object.prototype.valueOf() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)

##  In this article

  * Try it 
  * Syntax 
  * Description 
  * Examples 
  * Specifications 
  * Browser compatibility 
  * See also 

#  String.prototype.match()

The **` match() ` ** method of [ ` String ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/String) values retrieves the
result of matching this string against a [ regular expression ](/en-
US/docs/Web/JavaScript/Guide/Regular_expressions) .

##  Try it

##  Syntax

js

    
    
    match(regexp)
    

###  Parameters

` regexp `

    

A regular expression object, or any object that has a [ ` Symbol.match `
](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match) method.

If ` regexp ` is not a ` RegExp ` object and does not have a ` Symbol.match `
method, it is implicitly converted to a [ ` RegExp ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) by using ` new
RegExp(regexp) ` .

If you don't give any parameter and use the ` match() ` method directly, you
will get an [ ` Array ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Array) with an empty string: `
[""] ` , because this is equivalent to ` match(/(?:)/) ` .

###  Return value

An [ ` Array ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
whose contents depend on the presence or absence of the global ( ` g ` ) flag,
or [ ` null ` ](/en-US/docs/Web/JavaScript/Reference/Operators/null) if no
matches are found.

  * If the ` g ` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. 
  * If the ` g ` flag is not used, only the first complete match and its related capturing groups are returned. In this case, ` match() ` will return the same result as [ ` RegExp.prototype.exec() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) (an array with some extra properties). 

##  Description

The implementation of ` String.prototype.match ` itself is very simple â it
simply calls the ` Symbol.match ` method of the argument with the string as
the first parameter. The actual implementation comes from [ `
RegExp.prototype[@@match]() ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match) .

  * If you need to know if a string matches a regular expression [ ` RegExp ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) , use [ ` RegExp.prototype.test() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) . 
  * If you only want the first match found, you might want to use [ ` RegExp.prototype.exec() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) instead. 
  * If you want to obtain capture groups and the global flag is set, you need to use [ ` RegExp.prototype.exec() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) or [ ` String.prototype.matchAll() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll) instead. 

For more information about the semantics of ` match() ` when a regex is
passed, see [ ` RegExp.prototype[@@match]() ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match) .

##  Examples

###  Using match()

In the following example, ` match() ` is used to find ` "Chapter" ` followed
by one or more numeric characters followed by a decimal point and numeric
character zero or more times.

The regular expression includes the ` i ` flag so that upper/lower case
differences will be ignored.

js

    
    
    const str = "For more information, see Chapter 3.4.5.1";
    const re =