title: Any way to match "end of document" in a PHP regex?
body: <p>... i.e. <strong>NOT</strong> to match "end of line".</p>
  
  <p>$ in PHP matches "end of line".  This includes when you have the "m" flag.</p>
  
  <p>But what if you have a multi-line string and you want to match the very end of it (or for that matter the very beginning)</p>
  
  <p>I've done quite a bit of searching before daring to pose this question: searched the regex FAQ at SO, etc.  Also studied quite carefully the functioning of the various PHP regex modifiers <a href="http://php.net/manual/en/reference.pcre.pattern.modifiers.php" rel="nofollow noreferrer">here</a>.  In particular, on that page, I <em>thought</em> I had found the answer with the "D" modifier: "If this modifier is set, a dollar metacharacter in the pattern matches only at the end of the subject string... ".</p>
  
  <p>But ... if you read further in that para it then says: "This modifier is ignored if m modifier is set." (the "m" modifier is the "multi-line" modifier).</p>
  
  <p>So... I'm confused, flummoxed, etc. '/Help!/'</p>