title: Regex to check whether string starts with, ignoring case differences
body: <p>I need to check whether a word starts with a particular substring ignoring the case differences. I have been doing this check using the following regex search pattern but that does not help when there is difference in case across the strings.</p>
  
  <p>my case sensitive way:</p>
  
  <pre><code>var searchPattern = new RegExp('^' + query);
  if (searchPattern.test(stringToCheck)) {}
  </code></pre>