title: Regular expressions: How do I grab a block of text using regex? (in ruby)
body: <p>I'm using ruby and I'm trying to find a way to grab text in between the {start_grab_entries} and {end_grab_entries} like so:</p>
  
  <pre><code>{start_grab_entries}
  i want to grab
  the text that
  you see here in
  the middle
  {end_grab_entries}
  </code></pre>
  
  <p>Something like so:</p>
  
  <pre><code>$1 =&gt; "i want to grab
         the text that
         you see here in
         the middle"
  </code></pre>
  
  <p>So far, I tried this as my regular expression:</p>
  
  <pre><code>\{start_grab_entries}(.|\n)*\{end_grab_entries}
  </code></pre>
  
  <p>However, using $1, that gives me a blank. Do you know what I can do to grab that block of text in between the tags correctly?</p>