title: How to use regex with ansible file module
body: <p>I have the below file module that touches a file on remote hosts.</p>
  
  <pre><code> - name: create file
     file:
       path: "/oracle/{{ inventory_hostname }}/del.tmp"
       state: touch
     register: direxists
  
   - fail:
       msg: "Directory missing"
     when: direxists.changed == False
  </code></pre>
  
  <p>The issue is on the target hosts I may have <code>/oracle</code> or <code>/Oracle</code> folder. The letter 'o' could be case insensitive. Thus, I wanted the regex to work </p>
  
  <pre><code> path: "/[Oo]racle/{{ inventory_hostname }}/del.tmp"
  </code></pre>
  
  <p>But unfortunately, such regex is not supported by the file module. </p>
  
  <p>I will have to fall back to <code>shell</code> module &amp; use Unix commands instead; which I was not wanting. </p>
  
  <p>I wish to fail the play if both /Oracle or /oracle directories are missing. If anyone of the [Oo]racle directory exists my play should not fail. </p>
  
  <p>How can I achieve this requirement?</p>