title: How can I get sed to only match to the first occurrence of a character?
body: <p>I'm using <strong>GNU Sed 4.2.1</strong>. I'm trying to replace the second field in the following line (the password in <em>/etc/shadow</em>). <code>Awk</code> is not an option.</p>
  
  <pre><code>username:P@s$w0rDh@$H:15986:0:365::::
  </code></pre>
  
  <p>I've tried </p>
  
  <pre><code>sed -i 's/\(^[a-z]*\):.*?:/\1:TEST:/'
  </code></pre>
  
  <p>but nothing. I've tried many variations but for some reason I can't get it to only match that field. Help?</p>