Knowledge Walls
Laya
Hyderabad, Andhra Pradesh, India
String.prototype.match() Method in String Class of Javascript Syntax with Examples
2145 Views
Usage 
Match method is one of the regular expression method. Match searches given regular expression with a string and returns array object of matched strings.

Modifiers with match method:
/pattern/i   - returns case insensitive single string
/pattern/g  - global match with returns array of strings
/pattern/m - multiline match with strings
Syntax
string.match(/pattern/modifier);
Example
var data = "My name is Javascript. Javascript is a scripting language of client browsers.";
document.write(data.match(/script/g));
Output 
script,script,script
Try it 
Best Lessons of "Javascript Syntax with Examples"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details