RegEx - finding group at the end of the line
<p>Expression does not match if it is located at the end of the line:</p>

<pre><code>(\b%%\b([^%])*\b%%\b)
</code></pre>

<p>test string:</p>

<pre><code>djwk%%text%%doqdojd%%text.text.text%%kjwldjdflkljwfe%%body.text.text%%
</code></pre>

<p>as result:</p>

<pre><code>djwk_doqdojd_kjwldjdflkljwfe%%body.text.text%%
</code></pre>

<p>but the last one is missed (tested <a href="http://java-regex-tester.appspot.com/" rel="nofollow noreferrer">via</a>)</p>

<p>What I'm missing?</p>