title: TypeScript filter array matching regex expression
body: <p>I am trying to filter an array based on a set of regex expression.If the item in the array matches any of the regex expression,I want o push it to a different array.I read that I can use match() and test() to do this but I'm unable to underetand how to do so.Please help.Thanks in advance.</p>
  
  <p>Here are my regex exp:</p>
  
  <pre><code>RAM-HEXA-*F-Q1
  RAM-D-AT44-*-Q2
  RAM-D-AT44-*-Q3
  </code></pre>
  
  <p>My test Arr:</p>
  
  <pre><code>testData={
  [
          { value: 'RAM-HEXA-34F-Q1
  ' },
          { value: 'RAM-D-AT44-AQ-Q2
  ' },
          { value: 'RAM-D-AT44-ZS-Q3
  ' },
          { value: 'RAM-D-N7-9-Q3
  ' },
         { value: 'RAM-QUATRA-1F-Q1
  ' },
          { value: 'RAM-X-AT44-T-Q2
  ' }
        ]
  }
  </code></pre>
  
  <p>SO basically I am trying to get the items from testData that match the reg expresions. So I am trying to get a resulting array that looks like this:</p>
  
  <pre><code>filteredData={
  [
          { value: 'RAM-HEXA-34F-Q1
  ' },
          { value: 'RAM-D-AT44-AQ-Q2
  ' },
          { value: 'RAM-D-AT44-ZS-Q3
  ' }]
  </code></pre>