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
|
string.match(/pattern/modifier);
|
var data = "My name is Javascript. Javascript is a scripting language of client browsers.";
document.write(data.match(/script/g));
|
Output
script,script,script
|