title: Parse Text using scanner useDelimiter
body: <p>Looking to parse the following text file:<br>
  Sample text file:</p>
  
  <pre><code>&lt;2008-10-07&gt;text entered by user&lt;Ted Parlor&gt;&lt;2008-11-26&gt;additional text entered by user&lt;Ted Parlor&gt;
  </code></pre>
  
  <p>I would like to parse the above text so that I can have three variables:</p>
  
  <pre><code>v1 = 2008-10-07
  v2 = text entered by user
  v3 = Ted Parlor
  v1 = 2008-11-26
  v2 = additional text entered by user
  v3 = Ted Parlor
  </code></pre>
  
  <p>I attempted to use scanner and useDelimiter, however, I'm having issue on how to set this up to have the results as stated above.  Here's my first attempt:</p>
  
  <pre><code>import java.io.*;
  import java.util.Scanner;
  
  public class ScanNotes {
      public static void main(String[] args) throws IOException {
          Scanner s = null;
          try {
              //String regex = "(?&lt;=\\&lt;)([^\\&gt;&gt;*)(?=\\&gt;)";
              s = new Scanner(new BufferedReader(new FileReader("cur_notes.txt")));
              s.useDelimiter("[&lt;]+");
  
              while (s.hasNext()) {
                  String v1 = s.next();
                  String v2= s.next();
                  System.out.println("v1= " + v1 + " v2=" + v2);
              }
          } finally {
              if (s != null) {
                  s.close();
              }
          }
      }
  }
  </code></pre>
  
  <p>The results is as follows:</p>
  
  <pre><code>v1= 2008-10-07&gt;text entered by user v2=Ted Parlor&gt; 
  </code></pre>
  
  <p>What I desire is:</p>
  
  <pre><code>v1= 2008-10-07 v2=text entered by user v3=Ted Parlor
  v1= 2008-11-26 v2=additional text entered by user v3=Ted Parlor
  </code></pre>
  
  <p>Any help that would allow me to extract all three strings separately would be greatly appreciated.</p>