title: grep starts with capital and appears exactly three times
body: <p>I need to grep this: lines that start with a capital and that same capital has to appear EXACTLY 3 times in the line.
  E.g. this is a good line :</p>
  
  <pre><code>'X^[&lt;*'??X+BXK&lt;:B7#;}V0|&lt;|K!(P|HW}(1O@$JK_}}*.5H"Y&amp;^A)D$QS97R' 
  </code></pre>
  
  <p>(starts with X and X appears EXACTLY three times)
  I tried this, but apparently the backreferences between the brackets don't work properly: </p>
  
  <pre><code> ^\([A-Z]\)[^\1]*\1[^\1]*\1[^\1]* 
  </code></pre>
  
  <p>Why doesn't this work and how should I do it?</p>