python re match string in a file
<p>I want to match all the lines in a file either starting with <code>0D</code> and has 15 <code>Characters</code> or just having 15 digits. How  can i do this</p>

<pre><code>p_number = re.compile(r'(\d{15})')
f=open(infile)
for l in f:
  aa=re.findall(p_number,l)
  if aa &gt; 0:
     print aa
f.close() 
</code></pre>

<p><code>EDIT</code></p>

<p>If only the pattern is in the starting of the line.</p>
