title: JavaScript Regex Ignore Case
body: <p>I am trying to match a part of the string and it should be NOT case sensitive. I have the following code but I never get the replaced string. </p>
  
  <pre><code>var name = 'Mohammad Azam'
  var result = name.replace('/' + searchText + '/gi', "&lt;b&gt;" + searchText + "&lt;/b&gt;");
  </code></pre>
  
  <p>The searchText variable will be "moha" or "mo" or "moh". </p>
  
  <p>How can I get the matching thing in bold tags. </p>