title: Regex match string that starts with but does not include
body: <p>I'm trying to match file paths that start with any string from a list. This is what I am using for that:</p>
  
  <pre><code>^/(dir1|dir2|dir3|tmp|dir4)/
  </code></pre>
  
  <p>I'm also trying to match all paths that start with <code>/tmp/</code> but do not contain <code>special</code> after that.</p>
  
  <p>This should match:</p>
  
  <pre><code>/tmp/subdir/filename.ext
  </code></pre>
  
  <p>But this should not:</p>
  
  <pre><code>/tmp/special/filename.ext
  </code></pre>
  
  <p>I can't seem to find a way to get this done. Any suggestions would be greatly appreciated.</p>