title: Getting delimiters in Java pattern matching
body: <p>Given a pattern, we can slice a string <code>S</code> into multiple parts with <code>S.split(pattern)</code>.  However, the result is not what I want.  I want those strings that match the pattern, i.e. delimiters.  My idea is to use the split result to form a new pattern then split again, but that needs to consider tons of cases for various meta symbols.  Any straightforward way?</p>