title: Regex for valid sharepoint folder name
body: <p>I am trying to make regular expression for Valid sharepoint folder name, which have conditions:</p>
  
  <ol>
  <li>Cannot begin or end with a dot, </li>
  <li>Cannot contain consecutive dots and </li>
  <li>Cannot contain any of the following characters: ~ " # % &amp; * : &lt; > ? / \ { | }.</li>
  </ol>
  
  <p>Wrote Regex for 1st and 3rd point:</p>
  
  <pre><code>[^\.]([^~ " # % &amp; * : &lt; &gt; ? / \ { | }]+) [^\.]$
  </code></pre>
  
  <p>and for third <code>(?!.*\.\.).*)$</code> but they are not working properly and have to integrate them into one expression.
  Please help.</p>