title: Parsing valid parent directories with regex
body: <p>Given the string <code>a/b/c/d</code> which represents a fully-qualified sub-directory I would like to generate a series of strings for each step up the parent tree, i.e. <code>a/b/c</code>, <code>a/b</code> and <code>a</code>. </p>
  
  <p>With regex I can do a non-greedy <code>/(.*?)\//</code> which will give me matches of <code>a</code>, <code>b</code> and <code>c</code> or a greedy <code>/(.*)\//</code> which will give me a single match of <code>a/b/c</code>. Is there a way I can get the desired results specified above in a single regex or will it inherently be unable to create two matches which eat the same characters (if that makes sense)?</p>
  
  <p>Please let me know if this question is answered elsewhere... I've looked, but found nothing.</p>
  
  <p>Note this question is about whether it's possible with regex. I know there are many ways outside of regex.</p>