match whole word using Regex - Javascript

match whole word

Snippet Code


  
Rate this page :
  [ 0 votes]

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);

Tags


Ask Questions

Ask Question