Python and RegExp - search and match
<p>Some file(file.dat)</p>

<pre><code>#####Start####
sometext
sometext
From: email@address.net
some text
some text
####End#####
</code></pre>

<p><b>1</b></p>

<pre><code>import re
for line in open('file.dat'):
    _mail=re.search(r"\w+@\w+\.\w{2,4}").group()
print(type(_mail))
</code></pre>

<p><b>Out: 'NoneType'</b></p>

<p><b>2</b></p>

<pre><code>import re
for line in open('file.dat'):
    if(re.match(r"From:.*",line)):
        _mail=re.search(r"\w+@\w+\.\w{2,4}").group()
print _mail
</code></pre>

<p><b>Out: email@address.net</b></p>

<p>Explain me, please. Why can't I use first way?</p>
