title: Regex matching newline character by default in python
body: <p>I want to check whether the given string input is a number of six digits.</p>
  <p>Valid:</p>
  <pre class="lang-none prettyprint-override"><code>* 123456
  * 098765
  </code></pre>
  <p>Invalid:</p>
  <pre class="lang-none prettyprint-override"><code>* 123
  * 12345a
  * as3445
  * /n123456
  * 123456\n
  </code></pre>
  <p>My Python code:</p>
  <pre><code>bool(re.match(&quot;^[0-9]{6}$&quot;,string))
  </code></pre>
  <p>but this also matches <code>&quot;123456\n&quot;</code>.</p>
  <p>Why it is matching newline character and how to restrict this match?</p>