I want to extract a string from a string, whose values will change
<p>I have an output which will vary in length and values, and I wish to extract a value from it.</p>

<p>This is my output:</p>

<pre><code>'+CPBR: 1,"111",129,"0|2|XX"^M'
</code></pre>

<p>In this case, I want to extract the "XX",</p>

<p>However, I will want to extract the "9X" if the value is:</p>

<pre><code>'+CPBR: 1,"111",129,"01|2|9X"^M'
</code></pre>

<p>Does anybody know a good way to do this?</p>
