title: Extracting and splitting the string to create new string which have unique substring
body: <p>Though the Title of question is not clear enough, here is my query:</p>
  
  <p>I have an input String:</p>
  
  <pre><code>"this is text &lt;&lt;PATTERN&gt;&gt;some text1 &lt;&lt;/PATTERN&gt;&gt;&lt;&lt;PATTERN&gt;&gt;some text2 &lt;&lt;/PATTERN&gt;&gt;&lt;&lt;PATTERN&gt;&gt;some text3 &lt;&lt;/PATTERN&gt;&gt; end text"
  </code></pre>
  
  <p>I want to dispaly the output (or new string variable) as follows:</p>
  
  <pre><code>String 1= this is text &lt;&lt;PATTERN&gt;&gt;some text1 &lt;&lt;/PATTERN&gt;&gt; end text
  String 2= this is text &lt;&lt;PATTERN&gt;&gt;some text2 &lt;&lt;/PATTERN&gt;&gt; end text
  String 3= this is text &lt;&lt;PATTERN&gt;&gt;some text3 &lt;&lt;/PATTERN&gt;&gt; end text
  String n= this is text &lt;&lt;PATTERN&gt;&gt;some textn &lt;&lt;/PATTERN&gt;&gt; end text
  </code></pre>
  
  <p>Basically I want mutiple String having single occurence  </p>
  
  <pre><code> &lt;&lt;PATTERN&gt;&gt;some textn &lt;&lt;/PATTERN&gt;&gt;.
  </code></pre>
  
  <p>There can be mutiple occurence of <code>&lt;&lt;PATTERN&gt;&gt;......&lt;&lt;/PATTERN&gt;&gt;</code>  and next set of <code>&lt;&lt;PATTERN&gt;&gt;......&lt;&lt;/PATTERN&gt;&gt;</code> comes just after the previous.</p>
  
  <p>How I can acheive in JAVA?</p>