title: Using pcregrep -M to search for a multi-line string
body: <p>I am trying to use <code>pcregrep -M</code> to search for a multiline string.</p>
  
  <p>This is the line in my script:</p>
  
  <pre><code>lineNumber=$(pcregrep -Mn '$firstLine.*\n.*$secondLine.*' $myFile)
  </code></pre>
  
  <p><code>myFile</code> contains multiple lines of the form:</p>
  
  <pre><code>firstLine\n  
  secondLine(with other characters here that I don't need to match)
  </code></pre>
  
  <p>I get an empty string for <code>lineNumber</code> and that's all. </p>
  
  <p>What am I doing wrong?  </p>
  
  <p>What should I expect for the return value? Shouldn't <code>-n</code> give me the line number? And if so, which line number, first or second?</p>
  
  <p>Should I use <code>awk</code> or <code>sed</code> instead and if so how?</p>