title: Java - Best way to grab ALL Strings between two Strings? (regex?)
body: <p>This question has been bugging me for a long time now but essentially I'm looking for the most efficient way to grab all Strings between two Strings.</p>
  
  <p>The way I have been doing it for many months now is through using a bunch of temporary indices, strings, substrings, and it's really messy. (Why does Java not have a native method such as <code>String substring(String start, String end)</code>?</p>
  
  <p>Say I have a String:</p>
  
  <p><code>abcabc [pattern1]foo[pattern2] abcdefg [pattern1]bar[pattern2] morestuff</code></p>
  
  <p>The end goal would be to output <code>foo</code> and <code>bar</code>. (And later to be added into a JList)</p>
  
  <p>I've been trying to incorporate regex in <code>.split()</code> but haven't been successful. I've tried syntax using <code>*</code>'s and <code>.</code>'s but I don't think it's quite what my intention is especially since <code>.split()</code> only takes one argument to split against.</p>
  
  <p>Otherwise I think another way is to use the Pattern and Matcher classes? But I'm really fuzzy on the appropriate procedure.</p>