title: Grep to extract a word that starts and ends with a certain pattern
body: <p>I have a log file with entries like</p>
  
  <pre><code>INFO 2013-08-16 13:46:48,660 Index=abc:12 insertTotal=11  ERROR: [doc=abc:d1c3f0]
  INFO 2013-08-16 13:46:48,660 Index=abcd:12 insertTotal=11 ERROR: [doc=def:d1cwqw3f0]
  INFO 2013-08-16 13:46:48,660 Index=def:134 insertTotal=11  
  INFO 2013-08-16 13:46:48,660 Index=abkfe insertTotal=11
  INFO 2013-08-16 13:46:48,660 Index=lmkfe insertTotal=11
  INFO 2013-08-16 13:46:48,660 Index=lmkfe insertTotal=11
  </code></pre>
  
  <p>I need to grep the part between <strong>[doc=</strong> and <strong>]</strong> i.e abc:d1c3f0 and def:d1cwqw3f0
  So I am looking to do something like 
  ^(abc|def)*]$</p>