Regex match till end of text
<p>I'm using Regex to match whole sentences in a text containing a certain string. This is working fine as long as the sentence ends with any kind of punctuation. It does not work however when the sentence is at the end of the text without any punctuation.</p>

<p>This is my current expression:</p>

<pre><code> [^.?!]*(?&lt;=[.?\s!])string(?=[\s.?!])[^.?!]*[.?!]
</code></pre>

<p>Works for:</p>

<blockquote>
  <p>This is a sentence with <strong>string</strong>. More text.</p>
</blockquote>

<p>Does not work for:</p>

<blockquote>
  <p>More text. This is a sentence with <strong>string</strong></p>
</blockquote>

<p>Is there any way to make this word as intended? I can't find any character class for "end of text".</p>