title: How to write a correctly formatted regex for Apache 'DirectoryMatch'?
body: <p>I have tried writing this into my config file, to match folders only in that 'example' directory and no further sub-folders...</p>
  
  <pre><code>&lt;DirectoryMatch "\/var\/www\/html\/example\/[^/]+\/"&gt;
      IndexIgnore ..
  &lt;/DirectoryMatch&gt;
  </code></pre>
  
  <p>Other regex I have tried...</p>
  
  <pre><code>/var/www/html/example/[^/]+/
  /var/www/html/example/(.+/){1}
  </code></pre>
  
  <p>If I explicitly write the path to the folder, it works. Where am I going wrong?</p>
  
  <p>I see Apache uses Perl Compatible Regular Expressions provided by the <a href="http://www.pcre.org/" rel="nofollow noreferrer">PCRE</a> library.</p>
  
  <hr>
  
  <p>Server version: Apache/2.4.18 (Ubuntu)</p>
  
  <p>Server built:   2016-07-14T12:32:26</p>