title: match part of a string until it reaches the end of the line (python regex)
body: <p>If I have a large string with multiple lines and I want to match part of a line only to end of that line, what is the best way to do that?</p>
  
  <p>So, for example I have something like this and I want it to stop matching when it reaches the new line character. </p>
  
  <pre><code>r"(?P&lt;name&gt;[A-Za-z\s.]+)"
  </code></pre>
  
  <p>I saw this in a <a href="https://stackoverflow.com/questions/6822323/regex-match-the-text-before-the-end-of-line">previous answer</a>:</p>
  
  <blockquote>
    <p>$ - indicates matching to the end of the string, or end of a line if
    multiline is enabled.</p>
  </blockquote>
  
  <p>My question is then how do you "enable multiline" as the author of that answer states?</p>