title: Ansible. Find mac address and put in into variable
body: <pre><code>tasks:
         - name: Find mac-address
           ios_command:
             provider: "{{ cli }}"
             commands:
               - show mac add | i d83b
           register: sh_mac_res
  </code></pre>
  
  <p>sh_mac_res is variable contain string like this:</p>
  
  <pre><code> "22    18a9.0530.d83b    DYNAMIC     Fa0/17"
  </code></pre>
  
  <p>How can I  put <strong>18a9.0530.d83b</strong> into a variable?</p>
  
  <pre><code>set_facts:
    mac_address: {{ sh_mac_res.stdout }}.........????
  </code></pre>
  
  <p>What should I use? regex_search or something else?</p>