title: Cannot read properties of undefined (reading 'matches')
body: <p>I am trying to filter through an Array of Objects (Albums in my case), but I am getting this Error and everything I tried did not work.</p>
  <p><strong>My Searchbar :</strong></p>
  <pre><code>&lt;input type=&quot;search&quot; placeholder={&quot; &quot;} onChange={e =&gt; onChangeHandler(e.target.value)} value={text}/&gt;
  </code></pre>
  <p><strong>My onChangeHandler</strong></p>
  <pre><code>const onChangeHandler =(text) =&gt; {
          let matches = []
          if (text.length &gt; 0){
              matches = albums.filter(album =&gt; {
                  const regex = new RegExp(`${text}`, &quot;gi&quot;)
                  return (album.artist.matches(regex));
              });
          }
          console.log('matches', matches)
          setSuggestions(matches)
          setText(text)
      }
  </code></pre>
  <p>When I try, it works and I get the matches in the console, but only if I type everything correctly and case sensitive. That is not the goal tho.</p>
  <pre><code>return (album.artist === text);
  </code></pre>