title: Using grep to check usernames
body: <p>I search a <code>grep</code> command to check usernames like:-</p>
  
  <pre><code>mi.ma
  ab-bc
  ab.bc-ad
  ab_de
  mima
  </code></pre>
  
  <p>Not allowed should be:</p>
  
  <pre><code>..mima
  mima..
  mia--bc
  mia---ad
  ab___de
  __ab
  ab__
  </code></pre>
  
  <p>Allowed should be <code>a-z, 0-9, -, ., _</code> but not double <code>-, ., _</code> and this also not in front or end. And it must min. have 3 characters.</p>