title: Match dynamic string using regex
body: <p>I'm trying to detect an occurrence of a string within string. But the code below always returns "null". Obviously something went wrong, but since I'm a newbie, I can't spot it. I'm expecting that the code returns "true" instead of "null"</p>
  
  <pre><code>var searchStr = 'width'; 
  var strRegExPattern = '/'+searchStr+'\b/'; 
  "32:width: 900px;".match(new RegExp(strRegExPattern,'g'));
  </code></pre>