title: How can I match a whole word in JavaScript?
body: <p>I am trying to search a single whole word through a textbox. Say I search &quot;me&quot;, I should find all occurrences of the word &quot;me&quot; in the text, but not &quot;memmm&quot; per say.</p>
  <p>I am using JavaScript's <code>search('my regex expression')</code> to perform the current search (with no success).</p>
  <p>After several proposals to use the <code>\b</code> switches (which don't seem to work) I am posting a revised explanation of my problem:</p>
  <p>For some reason this doesn't seem to do the trick. Assume the following JavaScript search text:</p>
  <pre><code>var lookup = '\n\n\n\n\n\n2    PC Games        \n\n\n\n';
  lookup  = lookup.trim() ;
  alert(lookup );
  
  var tttt = 'tttt';
  alert((/\b(lookup)\b/g).test(2));
  </code></pre>
  <p>Moving lines is essential</p>