title: Overlapping regular expression
body: <p>I found a similar question <a href="https://stackoverflow.com/questions/7760162/returning-overlapping-regular-expressions">here</a>. However I didn't get it working:</p>
  
  <p>I have a string like "my_token_string" and need a regex to return the tokens "my_", "_token_", and "_string".</p>
  
  <p>Please note that I am not able to change the java-code because it's part of another software. The only thing I can do is specify the pattern and the group to capture :-)</p>
  
  <p>This is what I have tested:</p>
  
  <pre><code>String p = "(?=(_[^_]*_?))";
  int group = 1;
  String test = "my_token_string";
  
  Matcher m = Pattern.compile(p).matcher(test);
  while (m.find()) {
      System.out.println(m.group(group));
  }
  </code></pre>
  
  <p>But of course this returns only the tokens "_token_" and "_string".</p>