Javascript match() is used with regular expression in order to match all the occurrences of a string
var txt = 'Javascript is the client side scripting language, developed by netscape, used along with HTML to build a efficient web site / webpage.JavaScript is used in to create dynamic changes, validate forms, detect visitor details, create/use cookies, etc.. ';
//Matches all occurences of Javascript in the above variable
var matches = txt.match(/bJavascriptb/gi);