title: Java regex replace ignoring the first match
body: <pre><code>mediaSourceSpecificJunkCharacters=mediaSourceSpecificJunkCharacters+",";   
  Pattern p = Pattern.compile("\\[(.*?)\\],",Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
  Matcher matcher = p.matcher(mediaSourceSpecificJunkCharacters);
  while(matcher.find()) {
      String stringToMatch=matcher.group(1);
      System.out.println("string to match "+stringToMatch);
      originalText=originalText.replaceAll(stringToMatch.trim(),"");
  }
  </code></pre>
  
  <p>here <code>originalText="this is data from youtube youtube1 youtube2 youtube3 youtube4";</code>
  and <code>mediaSourceSpecificJunkCharacters=[youtube2],[youtube3],[youtube4]</code></p>
  
  <p>the first match is youtube3 and not youtube2....so youtube2 never gets replaced...why is it so?</p>