title: search list of string with wildcard and return matches & indexes python
body: <p>given a list</p>
  
  <pre><code>list=['beak','back','bear','kill','keel']
  </code></pre>
  
  <p>I'd like to perform a search with a wild card to return all words that match the pattern <code>k**l</code> for example. I can easily to this with the following:</p>
  
  <pre><code>regex=re.compile('k..l')
  matches=[string for string in list if re.match(regex, string)]
  </code></pre>
  
  <p>However, I'd also like to access the index of the position of the matches and have something like that:</p>
  
  <pre><code>matches=kill, keel
  locs=3,4
  </code></pre>
  
  <p>The reason why I want the indexes is that once the matches found I'd like to access a full row (containing other variables) in a df.</p>
  
  <p>Thanks for your help.</p>