title: Stop regular expression from matching across lines
body: <p>I have a regular expression, </p>
  
  <pre><code>end\\s+[a-zA-Z]{1}[a-zA-Z_0-9]
  </code></pre>
  
  <p>which is supposed to match a line with the specifications</p>
  
  <pre><code>end abcdef123
  </code></pre>
  
  <p>where <code>abcdef123</code> must start with a letter and subsequent alphanumeric characters.</p>
  
  <p>However currently it is also matching this</p>
  
  <pre><code>foobar barfooend
  bar fred bob
  </code></pre>
  
  <p>It's picking up that <code>end</code> at the end of <code>barfooend</code> and also picking up <code>bar</code> in effect returning <code>end bar</code> as a legitimate result.</p>
  
  <p>I tried</p>
  
  <pre><code>^end\\s+[a-zA-Z]{1}[a-zA-Z_0-9]
  </code></pre>
  
  <p>but that doesn't seem to work at all. It ends up matching nothing.
  It should be fairly simple but I can't seem to nut it out.</p>