Duplicating code should be avoided as much as possible. Could you extract the above into a function that given a slash-delimited input with an arbitrary number of slashes, return a list of tokens? It should handle escaping.