title: Search on a particular line using Regular Expression in Java
body: <p>I am new with Regular Expression and might be my question is very basic one.</p>
  
  <p>I want to create a regular expression that can search an expression on a particular line number.</p>
  
  <p>eg.
   I have data</p>
  
  <pre><code>"\nerferf erferfre erferf 12545" + 
  "\ndsf erf" + 
  "\nsdsfd refrf refref" + 
  "\nerferf erferfre erferf 12545" + 
  "\ndsf erf" + 
  "\nsdsfd refrf refref" + 
  "\nerferf erferfre erferf 12545" + 
  "\ndsf erf" + 
  "\nsdsfd refrf refref" + 
  "\nerferf erferfre erferf 12545" + 
  </code></pre>
  
  <p>And I want to search the number 1234 on 7th Line. It may or may not be present on other lines also. </p>
  
  <p>I have tried with </p>
  
  <pre><code>"\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\d{4}" 
  </code></pre>
  
  <p>but am not getting the result.</p>
  
  <p>Please help me out with the regular expression.</p>