JavaScript Reference/Javascript Methods/match

Материал из Web эксперт
Версия от 11:22, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"match()" Example

   <source lang="javascript">
   

<html> <body> <button onclick="var myS = new String("Sample String");

                alert(myS.match(/sam/i));">Match a string</button>

</body> </html>


     </source>
   
  


"match()" is applied to

   <source lang="javascript">

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

     </source>
   
  


"match()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Searches the String using a regular expression.

Syntax:

stringName.match(param1) Parameters:

   param1   Required; the regular expression.
   
     
     </source>