title: Regular Expression: Match Partial or full string
body: <p>I have small script that takes the value from a text input and needs to match an item in an array either partially or fully.</p>
  
  <p>I'm struggling at the moment with the regular expression and the syntax and wondered if I could pick your brains.</p>
  
  <pre><code>for (var i=0; i &lt; liveFilterData.length; i+=1) {
  
      if (liveFilterData[i].match(liveFilter.val())) {
          alert();
      }
  }
  </code></pre>
  
  <p>I need the liveFilter.val() and Regular Expression to match the current array item liveFilterData[i] so if someone types in H or h in the text box, it checks if there is a matching item in the array. If they type in He or he then it matches Head, Header or heading.</p>
  
  <p>Sorry, I've looked all over the web on how to build regular expressions but I can't work it out.</p>