title: re.search webpage source with a carriage return mid string causing errors in Python
body: <p>Using Python 2.6.6</p>
  
  <p>I'm trying to grab the title of youtube links using mechanize browser, and while it does work on links to actual videos, linking to a channel's page, or their playlists, etc, causes it to crash.</p>
  
  <p>The relevant code segment:</p>
  
  <pre><code>ytpage = br.open(ytlink).read()
  yttitle = re.search('&lt;title&gt;(.*)&lt;/title&gt;', ytpage)
  yttitle = yttitle.group(1)
  </code></pre>
  
  <p>The error:</p>
  
  <blockquote>
    <p>yttitle = yttitle.group(1)
    AttributeError: 'NoneType' object has no attribute 'group'</p>
  </blockquote>
  
  <p>The only difference I can see is that a direct video link lays out the title tags on <a href="https://i.pantsu.cat/qwjmxx.png" rel="nofollow">a single line</a> in the source whereas every other youtube page seems to put <a href="https://i.pantsu.cat/ddjvpe.png" rel="nofollow">a carriage return/newline</a> in the middle of the title tags.</p>
  
  <p>Anyone know how I can get around that carriage return, assuming that is the problem?</p>
  
  <p>Cheers.</p>