title: Differentiating between slashes in a string using a regular expression
body: <p>A program that I'm writing (in Java) gets input data made up of three kinds of parts, separated by a slash <code>/</code>. The parts can be one of the following:</p>
  
  <ol>
  <li>A <em>name</em> matching the regular expression <code>\w*</code> </li>
  <li>A <em>call</em> matching the expression <code>\w*\(.*\)</code> </li>
  <li>A <em>path</em> matching the expression <code>&lt;.*&gt;|\".*\"</code>. A <em>path</em> can contain slashes.</li>
  </ol>
  
  <p>An example string could look like this: </p>
  
  <pre><code>bar/foo()/foo(bar)/&lt;foo/bar&gt;/bar/"foo/bar"/foo()
  </code></pre>
  
  <p>which has the following structure</p>
  
  <pre><code>name/call/call/path/name/path/call
  </code></pre>
  
  <p>I want to split this string into parts, and I'm trying to do this using a regular expression. My current expression captures slashes after <em>calls</em> and <em>paths</em>, but I'm having trouble getting it to capture slashes after <em>names</em> without also including slashes that may exist within paths. My current expression, just capturing slashes after <em>paths</em> and <em>calls</em> looks like this:</p>
  
  <pre><code>(?&lt;=[\)&gt;\"])/
  </code></pre>
  
  <p>How can I expand this expression to also capture slashes after <em>names</em> without including slashes within <em>paths</em>? </p>