title: Ansible: how to handle dots while using search or match functions
body: <p>Here are the two scenarios and variable prefix will just hold another string.</p>
  
  <p>1)This works:</p>
  
  <pre><code> when: ansible_hostname | search("{{ prefix }}-test-.*")
  </code></pre>
  
  <p>2)This doesn't work probably because of dots in the search string.</p>
  
  <pre><code> when: ansible_hostname | search("{{ prefix }}-test-.*.tin.com)
  </code></pre>
  
  <p>I even tried escaping dots without any success.</p>
  
  <pre><code>when: ansible_hostname | search("{{ prefix }}-test-.*\.tin\.com)
  </code></pre>