title: Numpy.where on an array of strings using regex
body: <p>I have an array like:</p>
  
  <pre><code>array = ['A0','A1','A2','A3','A4','B0','B1','C0']
  </code></pre>
  
  <p>and want to obtain an array which is true for values with an A followed by a number ranging from 0 to 2.</p>
  
  <p>So far, this is the way I do it:</p>
  
  <pre><code>selection = np.where ((array == 'A0') | (array == 'A1') | (array == 'A2'), 1, 0)
  </code></pre>
  
  <p>But is there a more elegant way to do this by using e.g., a regular expresion like:</p>
  
  <pre><code>selection = np.where (array == 'A[0-1]', 1, 0)
  </code></pre>