Extracting year from string in python
<p>How can I parse the foll. in python to extract the year:</p>

<pre><code>'years since 1250-01-01 0:0:0'
</code></pre>

<p>The answer should be 1250</p>

<p>The following regex should make the four digit year available as the first capture group:</p>

<pre><code>^.*\(d{4})-\d{2}-\d{2}.*$
</code></pre>

python regex