title: Getting values from array that matches a regular expression using lodash
body: <p>My json array:</p>
  
  <pre><code>[{"id":"7","name":"hello"},{"id":"7","name":"shan"},{"id":"7","name":"john"}
  {"id":"7","name":"hello"}]
  </code></pre>
  
  <p>I want to get a new array that matches a regular expression on <code>name</code> starting with a letter. </p>
  
  <p>I am using <a href="https://lodash.com/docs#isRegExp" rel="nofollow">regexp</a> but i don't know how to implement it.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>var newitem=_.filter(result,item=&gt;item.name='hello');
   console.log(newitem);
  </code></pre>
  
  <p>But it returns with only strict match of <code>name</code>.</p>
  
  <p>Please help me to modify the above so that the result is a new array as described.</p>
  
  <p><strong>Expected output</strong> </p>
  
  <p>when a usertype letter <code>h</code> it shows only the row</p>
  
  <pre><code>{"id":"7","name":"hello"}
  </code></pre>