title: If any strings in a list match regex
body: <p>I need to check if any of the strings in a list match a regex.  If any do, I want to continue.  The way I've always done it in the past is using list comprehension with something like:</p>
  
  <pre><code>r = re.compile('.*search.*')
  if [line for line in output if r.match(line)]:
    do_stuff()
  </code></pre>
  
  <p>Which I now realize is pretty inefficient.  If the very first item in the list matches, we can skip all the rest of the comparisons and move on.  I could improve this with:</p>
  
  <pre><code>r = re.compile('.*search.*')
  for line in output:
    if r.match(line):
      do_stuff()
      break
  </code></pre>
  
  <p>But I'm wondering if there's a more pythonic way to do this.</p>