title: Apparent inconsistency with RegEx pattern - Python 3
body: <p>I'm trying to extract some data from an HTML document with re module in Python 3.
  I downloaded the source HTML of this URL: <a href="http://diablo2.diablowiki.net/Rune_list" rel="nofollow">http://diablo2.diablowiki.net/Rune_list</a> and renamed the file as <code>rune_list.html</code>.</p>
  
  <p>What I want is in the <code>div</code> block with <code>id="mw-content-text"</code>,
  so I wrote this code:</p>
  
  <pre><code>import re
  
  file=open('rune_list.html','r')
  data=file.read()
  file.close()
  
  pat=re.compile(r'&lt;div id="mw-content-text"[\s\S]*&lt;/div&gt;')
  found=re.search(pat,data)
  </code></pre>
  
  <p>And..nothing found. I know that maybe the regex is not so good, because as I understood, the presence of * could include other <code>&lt;/div&gt;</code>  into this one, making the matched string a huge chunk of <code>div</code>s.</p>
  
  <p>But why it doesn't find anything?
  I tried the same exact pattern with a file written by me, a long string
  that begins with "<code>&lt;div id="mw-</code>..." and ends with "<code>&lt;/div&gt;</code>", with some random tables in it, to mimic what I want to find: in this case a matching string is found.The regex, although not well written, should work on the original too. I know that these lines are present in the document.</p>
  
  <p>So I tried simpler searches on the original document: first I searched for <code>mw-content-text</code>, without double quotes, and a matching string is found.
  Then I tried <code>"mw-content-text"</code>, with double quotes, and nothing is found.It doesn't find the bigger pattern because it doesn't find this one.</p>
  
  <p>It's confusing, if I search for <code>&lt;div id="mw-</code>... manually in the source page (opened via "view page source" on the browser), the element is there.Besides, I already done some searches with regex on other HTML documents with similar codes, and it works (kinda). I know (and used a bit) other solutions to this problem (e.g. <code>BeautifulSoup</code>), but I want to try with regex as an exercise.</p>
  
  <p>What am I missing?</p>