title: Search for a pattern in numpy array
body: <p>Is there a simple way to find all relevant elements in NumPy array according to some pattern?</p>
  
  <p>For example, consider the following array:</p>
  
  <pre><code>a = array(['zzzz', 'zzzd', 'zzdd', 'zddd', 'dddn', 'ddnz', 'dnzn', 'nznz',
         'znzn', 'nznd', 'zndd', 'nddd', 'ddnn', 'dnnn', 'nnnz', 'nnzn',
         'nznn', 'znnn', 'nnnn', 'nnnd', 'nndd', 'dddz', 'ddzn', 'dznn',
         'znnz', 'nnzz', 'nzzz', 'zzzn', 'zznn', 'dddd', 'dnnd'], dtype=object)
  </code></pre>
  
  <p>And I need to to find all combinations which contain '**dd'.</p>
  
  <p>I basically need a function, which receives the array as input and returns a smaller array with all relevant elements:</p>
  
  <pre><code>&gt;&gt; b = func(a, pattern='**dd')
  &gt;&gt; b = array(['zzdd', 'zddd', 'zndd', 'nddd', 'nndd', 'dddd'], dtype=object)
  </code></pre>