title: How to check if string exists in array returned by an ansible task
body: <p>Im running an ansible task and want to see if a substring exists in list that is returned by the task that is run.</p>
  
  <p>The task uses the <code>win_shell</code> module and executes the following command: <code>netstat -aon | sls 8080"</code></p>
  
  <p>In the case that process is running, the result will look like this:</p>
  
  <pre><code>stdout_lines: [
      "",
      "",
      " TCP     127.0.0.1:8080     0.0.0.0:0      LISTENING 9196",
      ""
  ]
  </code></pre>
  
  <p>In python I would do something like this to check if a substring existed in an element in a list.</p>
  
  <p><code>matching = [s for s in some_list if "8080" in s]</code></p>
  
  <p>Is there a way to achieve that in ansible?</p>