title: How do you match a specific word from multiple lines using regex?
body: <p>I'm trying to match the word "first_name" from the below snippet:</p>
  
  <pre><code>&lt;div class="field"&gt;
      &lt;%= f.label :first_name %&gt;&lt;br /&gt;
      &lt;%= f.text_field :first_name %&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>Using something like this regular expression:</p>
  
  <pre><code>&lt;div class="field"&gt;((\n|.)*?)&lt;\/div&gt;
  </code></pre>
  
  <p>gives me:</p>
  
  <pre><code>&lt;%= f.label :first_name %&gt;&lt;br /&gt;
  &lt;%= f.text_field :first_name %&gt;
  </code></pre>
  
  <p>(Here is the expression in action: <a href="http://rubular.com/r/uh6SZ6EGcQ" rel="nofollow">http://rubular.com/r/uh6SZ6EGcQ</a>)</p>
  
  <p>Since I only want "first_name", what regular expression should I use such that I can match only the "first_name"? </p>