title: how to parse output from ansible
body: <p>my playlist has below contests </p>
  
  <pre><code>- set_fact:
      ip={{output_result.cmd | regex_findall('[0-9./]+') | list}}
    register: ip_result
  
  - debug:
      var: ip_result.ansible_facts.ip
  </code></pre>
  
  <p>And getting below output (It comes with IP and port associated with it.)</p>
  
  <pre><code>TASK [debug] 
  *********************************************************
  ok: [localhost] =&gt; {
      "ip_result.ansible_facts.ip": [
          "192.168.2.157", 
          "3306"
      ]
  </code></pre>
  
  <p>But I am not able to get only <strong>192.168.2.157</strong> , how do I do that with ansible?</p>
  
  <p>I also trying set regex_search instead of regex_findall</p>
  
  <pre><code>  ip={{output_result.cmd| regex_search('[0-9./]+') | list}}
  </code></pre>
  
  <p>But output which I am getting is like </p>
  
  <pre><code>  TASK [debug] 
    ****************************************************************
    ok: [localhost] =&gt; {
      "ip_result.ansible_facts.ip": [
          "1", 
          "9", 
          "2", 
          ".", 
          "1", 
          "6", 
          "8",
          ".", 
          "2", 
          ".", 
          "1", 
          "5", 
          "7", 
          ".", 
          ".", 
          "."
      ]
  </code></pre>