title: Regex: match all but two dots
body: <p>I'm trying to validate a system path. This path is valid if it begins with some dirs and don't contain two dots one another.</p>
  
  <pre><code>#valid path
  /home/user/somedir/somedir_2
  #evil path
  /home/user/../somedir_2/
  </code></pre>
  
  <p>I know how to check for two dots in a path:</p>
  
  <pre><code>\.\. or [\.]{2}
  </code></pre>
  
  <p>But I really want to do something like that:</p>
  
  <pre><code>/home/user/&lt;match everything but two dots&gt;/somedir_2/
  </code></pre>
  
  <p>so that "match everything but two dots" can be everything but two dots.</p>
  
  <p>I have tried:</p>
  
  <pre><code>/home/user/[^\.{2}]*/somedir_2/
  </code></pre>
  
  <p>but without any success.</p>