title: regex matching characters in a long string in java
body: <p>I am building a JSP but I am new to regex and am having some trouble. I have a very long string with a pattern that looks like this:</p>
  
  <pre><code>==SOME_ID== - item 1 - item 2 - item 3 .. item 100 == SOME_ID_2 == - item 1 - item 2 - item 3 ... item 100 == SOME_ID_3 == ...
  </code></pre>
  
  <p>so it has the "identifier" which is enclosed in '==' characters, followed by a dash "-" separated list. I am trying to extract the Indentifiers and their item elements. Once I have the information extracted from the string I plan on constructing an XML document with the information.</p>
  
  <p>One more note, an "item" can be more than one word. </p>
  
  <p>EDIT: here is my code so far</p>
  
  <pre><code>&lt;%
  String testStr = (String)pageContext.getAttribute("longStr");
  String[] ids = null; 
  String delimeterRegex = "(?i),==*==";
  ids = testStr.split(delimeterRegex);
  pageContext.setAttribute("ids", ids);
  %&gt;
  
  
  
  &lt;c:forEach items="${ids}" var="id"&gt;
      ${id}
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>Any help would be greatly appreciated. Thank you </p>