Compare Revisions

String.prototype.match()

Revision 417771:

Revision 417771 by Sheppy on

Revision 459731:

Revision 459731 by mikemcg on

Title:
String.match
String.match
Slug:
Web/JavaScript/Reference/Global_Objects/String/match
Web/JavaScript/Reference/Global_Objects/String/match
Tags:
"String Methods","JavaScript Reference","String","Regular Expressions","JavaScript"
"String Methods","JavaScript Reference","String","Regular Expressions","JavaScript"
Content:

Revision 417771
Revision 459731
n61      If the regular expression does not include the <code>g</codn61      If the regular expression does not include the <code>g</cod
>e> flag, returns the same result as <a href="/en-US/docs/JavaScri>e> flag, returns the same result as <a href="/en-US/docs/JavaScri
>pt/Reference/Global_Objects/RegExp/exec" title="JavaScript/Refere>pt/Reference/Global_Objects/RegExp/exec" title="JavaScript/Refere
>nce/Global_Objects/RegExp/exec"><code><em>regexp</em>.exec(<em>st>nce/Global_Objects/RegExp/exec"><code><em>regexp</em>.exec(<em>st
>ring</em>)</code></a>.>ring</em>)</code></a>. <span style="line-height: 1.572;">The retu
 >rned&nbsp;</span><a href="/en-US/docs/JavaScript/Reference/Global
 >_Objects/Array" style="line-height: 1.572;" title="JavaScript/Ref
 >erence/Global_Objects/Array"><code style="font-size: 14px;">Array
 ></code></a><span style="line-height: 1.572;">&nbsp;has an extra&n
 >bsp;</span><code style="font-size: 14px;">input</code><span style
 >="line-height: 1.572;">&nbsp;property, which contains the regexp 
 >that generated it as a result. In addition, it has an&nbsp;</span
 >><code style="font-size: 14px;">index</code><span style="line-hei
 >ght: 1.572;">&nbsp;property, which represents the zero-based inde
 >x of the match in the string.</span>
t65    </p>t
66    <p>
67      The returned <a href="/en-US/docs/JavaScript/Reference/Glob
>al_Objects/Array" title="JavaScript/Reference/Global_Objects/Arra 
>y"><code>Array</code></a> has an extra <code>input</code> propert 
>y, which contains the regexp that generated it as a result. In ad 
>dition, it has an <code>index</code> property, which represents t 
>he zero-based index of the match in the string. 

Back to History