How to derive desired sequence from a string using standard java api?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3970379/how-to-derive-desired-sequence-from-a-string-using-standard-java-api">How to derive desired sequence from a string using standard java api?</a>  </p>
</blockquote>



<p>I need to get parts of a string in a particular format. Tried
everything from split, substring to pattern and matcher. but everytime
it fails with one of the requirements.</p>

<p>Suppose</p>

<pre><code>str = (((abc) shdj (def) iueexs (ghi)) mkek ONE(tree23) bjm
(twooo(bug OR bag)) mvnj THR-EE(&lt;*&gt;$##))
</code></pre>

<p>And terms wanted are :</p>

<pre><code>"Hard Coded Term1":abc
"Hard Coded Term2":def
"Hard Coded Term3":ghi
ONE:tree23
twooo:bug,bag
THR-EE:&lt;*&gt;$##
</code></pre>

<p>Provision to hard code the terms as in the case of first three.
Help!Help!</p>
