title: Get Current Delimiter Used by Scanner Class
body: <p>Is it possible to get the <em>current</em> delimiter a Scanner is using, when that delimiter is a regular expression? For example I have this code:</p>
  
  <pre class="lang-java prettyprint-override"><code>        String dictionary = "computer: A computer is an electronic machine that can store\n"
                            + "          and deal with large amounts of information.\n"
                            + "computer-aided: done or improved by computer\n"; 
          Scanner src = new Scanner(dictionary);
          String delimiterRegex = "^(.+?:)"; // &lt;-- Matches a new term
          Pattern delimiterPattern = Pattern.compile(delimiterRegex, Pattern.MULTILINE);
          src.useDelimiter(delimiterPattern);
          String definition = "";
          String term = "";
  
          while(src.hasNext())
          {
              definition = src.next();
              term = ???????; // &lt;--- The term is the current delimiter match
          }
  </code></pre>
  
  <p>This is a very easy way to get all of the definitions, if only I could also get the term. </p>