Also, I don't think you have to backslash `/` inside a `[]` (just tried this in the console and it seemed to work without it). So I think this could even be `/^\/[^/]+\/([^/]+)(\/?)$/`.