title: Find the first occurrence of a pattern match in a file and then stop traversing the data
body: <p>I have a file having such data</p>
  
  <pre><code>D11/22/1984 D 123 q423 ooo 11/22/1987
  R11/22/1985 123 q423 ooo 11/22/1987
  D12/24/1986 123 q423 ooo 11/22/1987
  511/27/1987 123 q423 ooo 11/22/1987
  D18/29/1988 123 q423 ooo 11/22/1987
  </code></pre>
  
  <p>I need to pick the first occurrence of a record matching the pattern <code>^D(\d{2}/\d{2}/\d{4})</code> and then break and stop traversing through rest of the file.</p>
  
  <p>For example in the data mentioned above I just want to pick the value <code>D11/22/1984</code> and not <code>D12/24/1986</code> or <code>D18/29/1988</code>.</p>
  
  <p>I want to write it in Python using the <code>re</code> module.</p>