title: Search and extract string in javascript array
body: <p>I have a array in javascript containing "aassd,<strong>v_value1</strong>,asadds,<strong>v_value2</strong>, asddasd...", and I need extract the values that begin with <strong>v_</strong> in a new array. </p>
  
  <p>I used the next function to get the values, but only get the first value.</p>
  
  <pre><code>function search (array,string) {
  
      var arr= [];
  
      for (var i=0; i&lt;array.length; i++) {
          if (array[i].match(string)){
  
            arr.push(i)
  
            return arr;
          }  
      }
        return -1;
    }
  
   search(array,'v_')
  </code></pre>
  
  <p>Thanks.    </p>