title: Regex for capturing all occurrences of text delimited by a sequence of characters
body: <p>Is it possible to construct a regular expression that captures <strong>all occurrences</strong> of text delimited by a sequence of characters? In other words, I am looking for an equivalent of standard <code>.split()</code> method.</p>
  
  <p>I can't use <code>split()</code>, because the regular expression is used in specifying URL routes for Tornado web application. For example:</p>
  
  <pre><code>handlers = [
      (r'/posts/([0-9a-zA-Z_\-]+)', PostsHandler),
  ]
  </code></pre>
  
  <p>Such a regular expression comes in handy when specifying URL routes for web applications built on top of Tornado, Django or any other web framework which implements Routes pattern. In particular, to parse a URL path of unknown length into a list of arguments.</p>
  
  <p>So far I have managed to come up with the following regular expression:</p>
  
  <pre><code>/^\/posts(?:\/([a-zA-Z0-9_\-]+))+/
  </code></pre>
  
  <p>Unfortunately, while the expression matches <code>/posts/show/some-slug/15</code>, it only returns the last matching group (<code>15</code>), instead of <code>['show', 'some-slug', '15']</code>.</p>
  
  <p>What I want is achieve is:</p>
  
  <ul>
  <li><code>/posts/edit/15/</code> => <code>['edit', '15']</code></li>
  <li><code>/posts/edit/15</code> => <code>['edit', '15']</code></li>
  <li><code>/posts/2010/15/11</code> => <code>['2010', '15', '11']</code></li>
  </ul>