title: PHP Regex: Select all except last occurrence
body: <p>I'm trying to replace all <code>\n</code>'s sans that final one with <code>\n\t</code> in order to nicely indent for a recursive function.</p>
  
  <pre><code>This
  that
  then
  thar
  these
  them
  </code></pre>
  
  <p>should become:</p>
  
  <pre><code>This
      that
      then
      thar
      these
  them
  </code></pre>
  
  <p>This is what I have: <code>preg_replace('/\n(.+?)\n/','\n\t$1\n',$var);</code></p>
  
  <p>It currently spits this out:</p>
  
  <pre><code>This
      that
  then
  thar
  these
  them
  </code></pre>
  
  <h1>Quick Overview:</h1>
  
  <p>Need to indent every line less the first and last line using regex, how can I accomplish this?</p>