r. In your pattern, this character <em>must</em> be escaped: use <strong>\/</strong>.</p>
<pre><code>    ^You have (.*)\/(.*) HP,
</code></pre>
<p>Now we can add the middle section:</p>
<pre><code>    40/50 MP
</code></pre>
<p>Which matches the pattern:</p>
<pre><code>    (.*)\/(.*) MP
</code></pre>
<p>Finally the end section:</p>
<pre><code>     and 5/99 SP.
</code></pre>
<p>Which matches the pattern:</p>
<pre><code>     and (.*)\/(.*) SP\.
</code></pre>
<p>Putting them all together, we get this pattern:</