title: What's the most efficient way to find one of several substrings in Python?
body: <p>I have a list of possible substrings, e.g. <code>['cat', 'fish', 'dog']</code>. In practice, the list contains hundreds of entries. </p>
  
  <p>I'm processing a string, and what I'm looking for is to find the index of the first appearance of any of these substrings.</p>
  
  <p>To clarify, for <code>'012cat'</code> the result is 3, and for <code>'0123dog789cat'</code> the result is 4. </p>
  
  <p>I also need to know which substring was found (e.g. its index in the substring list or the text itself), or at least the length of the substring matched.</p>
  
  <p>There are obvious brute-force ways to achieve this, I wondered if there's any elegant Python/regex solution for this.</p>