title: How to use non-greedy in vim?
body: <p>Input</p>
  
  <pre><code>\sn{1}\gn{2}\gn{3}\sn{4}\sn{5}\gn{6}\gn{7}\sn{8}\yr{2012}
  </code></pre>
  
  <p>Required output</p>
  
  <pre><code>\sn{1}\sn{4}\yr{2012}
  </code></pre>
  
  <p>I used this code. but failed.</p>
  
  <pre><code>%s/\\sn{\([^}]*\)}.*\\sn{\([^}]*\)}.*\\yr/\sn{\1}\sn{\2}\yr{\3}/gec 
  </code></pre>