The program that I write (in Java) receives input consisting of three kinds of parts, separated by a slash / . Parts may be as follows:
- The name matching the regular expression
\w* - A call corresponding to the expression
\w*\(.*\) - The path corresponding to the expression
<.*>|\".*\" . A path may contain slashes.
An example line might look like this:
bar/foo()/foo(bar)/<foo/bar>/bar/"foo/bar"/foo()
which has the following structure
name/call/call/path/name/path/call
I want to break this string into pieces, and I'm trying to do this using a regex. My current expression captures slashes after calls and paths, but I am having trouble capturing slashes after names without including slashes that may exist within paths. My current expression, just capturing slashes after paths and calls, is as follows:
(?<=[\)>\"])/
How can I extend this expression to also write slashes after names without including a slash in the path?
source share