title: Merge two regex expressions
body: <p>I'm having difficulties to merge two regex expressions.</p>
  
  <p>Because i'm not so familiar with it i wrote regexes separetely:</p>
  
  <p>1) No letters can be more than twice in a row, the symbols "'" and "-" are allowed too:</p>
  
  <pre><code>^(?!.*([A-Za-z])\1{2})[-'A-Za-z]{3,50}$
  </code></pre>
  
  <p>2) There can not be two allowed symbols in a row:</p>
  
  <pre><code>^(?!.*([A-Za-z])\1{2})[-'A-Za-z]{3,50}$
  </code></pre>
  
  <p>It fixes the "--" and "''" issue, but still need to think a way to dissalow "-'" or "'-"</p>
  
  <p>I'm trying to merge them in one, like so:</p>
  
  <pre><code>^(?!.*([A-Za-z])\1{2}|([-'])(?!\2))[-'A-Za-z]{3,50}$
  </code></pre>
  
  <p>But seems like my hands are broken. Please tell me where is my mistake?</p>
  
  <p>What i want to achieve:</p>
  
  <p>1) No more than 2 same <strong>letters</strong> in a row.</p>
  
  <p>Pass: <code>Test</code>, <code>Teest</code><br/>
  Fail: <code>Teeest</code>, <code>tttest</code></p>
  
  <p>2) No more than 1 special (only two are allowed - ' and -) symbol in a row.</p>
  
  <p>Pass: <code>Te-st</code>, <code>tes't</code>, <code>-test</code>, <code>'test</code>, <code>test-</code>, <code>test'</code>, <code>T-e-s-t</code><br/>
  Not pass: <code>Te--st</code>, <code>tes''t</code>, <code>-'test</code>, <code>'-test</code>, <code>test'-</code>, <code>test-'</code></p>
  
  <p>3) Minimum is 3 <strong>letters</strong> ( special symbols do not count ) and maximum is 50 symbols ( <strong>special symbols count</strong> )</p>
  
  <p>Pass: <code>Te-s-t</code>, <code>tes't</code>, <code>-test</code>, <code>'test</code>, <code>test-</code>, <code>test'</code><br/>
  Not pass: <code>te-</code>, <code>-te</code>, <code>t-e</code>, <code>'t'</code></p>