title: Regex search list of strings in list of string
body: <p>I have a list with words I wish to look for in another list:</p>
  
  <pre><code>listex = ['cat', 'mouse', 'dog']
  </code></pre>
  
  <p>And another list which is the one I wish to search through with the respective words in the list above:</p>
  
  <pre><code>listsearch = ['Hi there is a rabbit', 'how many dogs?', 'hot weather']
  </code></pre>
  
  <p>My thought is to use regex for each of the words in 'listex' on each of the strings in 'listsearch'. My goal is to get the index of the string in 'listsearch' that has been matched. For now, I have tried the following:</p>
  
  <pre><code>for search in listsearch:
    x = search
    if re.search(r"(?=("+'|'.join(listex)+r"))",x) is not None:
      a = re.search(r"(?=("+'|'.join(listex)+r"))",x)
      a=a.group(1)
      print(a)
  
  dog
  </code></pre>
  
  <p>So what my current code gives me is the output "dog". But what I wish to get is the index that was matched in the "listsearch" - i.e. in the example above, I wish to get the index 1, as that is the index in "listsearch" that contains the word "dog"</p>
  
  <p>Any ideas on how to get the index in the case?</p>