title: Extract string from brackets
body: <p>I'm pretty new at bash so this is a pretty noob question..</p>
  
  <p>Suppose I have a string:</p>
  
  <pre><code>string1 [string2] string3 string4
  </code></pre>
  
  <p>I would like to extract <code>string2</code> from the square brackets; but the brackets may be surrounding any other string at any other time. </p>
  
  <p>How would I use <code>sed</code>, etc, to do this? Thanks!</p>