title: Get substring from file using "sed"
body: <p>Can anyone help me to get substring using <a href="http://en.wikipedia.org/wiki/Sed" rel="nofollow noreferrer">sed</a> program?</p>
  
  <p>I have a file with this line:</p>
  
  <pre><code>....
  define("BASE", "empty"); # there can be any string (not only "empty").
  ....
  </code></pre>
  
  <p>And I need to get "empty" as string variable to my bash script.</p>
  
  <p>At this moment I have:</p>
  
  <pre><code>sed -n '/define(\"BASE\"/p' path/to/file.ext
  # returns this line:
  # define("BASE", "empty");
  # but I need 'empty'
  </code></pre>
  
  <p><strong>UPD:</strong> Thanks to <a href="https://stackoverflow.com/users/970195/jaypal">@Jaypal</a></p>
  
  <p>For now I have bash script:</p>
  
  <pre><code>DBNAME=`sed -n '/define(\"BASE\"/p' path/to/file.ext`
  echo $DBNAME | sed -r 's/.*"([a-zA-Z]+)".*/\1/'
  </code></pre>
  
  <p>It work OK, but if there any way to make the same manipulation with one line of code?</p>