Python re.match not matching string ending with ".number"
<p>As part of a bigger code I am trying to check if a <strong>string(filename)</strong> ends with <strong>".number"</strong>
However, re.match (re.compile and match) just wont match the pattern at end of the string.</p>

<p>Code: </p>

<pre><code>import re
f = ".1.txt.2"
print re.match('\.\d$',f)
</code></pre>

<p>Output:</p>

<pre><code>&gt;&gt;&gt; print re.match('\.\d$',f)
None
</code></pre>

<p>Any help will be much appreciated !</p>