title: Filtering zsh array by wildcard
body: <p>Given a Zsh array myarray, I can make out of it a subset array </p>
  
  <pre><code>set -A subarray
  for el in $myarray
  do 
    if [[ $el =~ *x*y* ]]
    then
      subarray+=($el)
    fi
  done
  </code></pre>
  
  <p>which, in this example, contains all elements from <em>myarray</em> which have somewhere an <em>x</em> and an <em>y</em>, in that order.</p>
  
  <p>Question:</p>
  
  <p>Given the plethora of array operations available in zsh, is there an easier way to achieve this? I checked the man page and the <a href="http://grml.org/zsh/zsh-lovers.html" rel="noreferrer">zsh-lovers page</a>, but couldn't find anything suitable.</p>