JavaScript Reference/Javascript Methods/match

Материал из Web эксперт
Перейти к: навигация, поиск

"match()" Example

    
<html>
<body>
<button onclick="var myS = new String("Sample String"); 
                 alert(myS.match(/sam/i));">Match a string</button>
</body>
</html>



"match()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |String                                                        |
+----------------+--------------------------------------------------------------+



"match()" Syntax, Parameters and Note

Note:
Searches the String using a regular expression.
    
Syntax:
    
stringName.match(param1)
Parameters:
    param1   Required; the regular expression.