If the number of paths is arbitrary, you need a two-step approach:
First, remove all "uninteresting things" from the line.
Find .*?/\d+/([^/]+/?)and replace everything with $1.
In C #: resultString = Regex.Replace(subjectString, @".*?/\d+/([^/]+/?)", "$1");
In JavaScript: result = subject.replace(/.*?\/\d+\/([^\/]+\/?)/g, "$1");
VOBSWeb/VobsWebUI/VaultWeb/func.js.
, .
(.*/)([^/]+)$ $2;$1$2.
#: resultString = Regex.Replace(subjectString, "(.*/)([^/]+)$", "$2;$1$2");
JavaScript: result = subject.replace(/(.*\/)([^\/]+)$/g, "$2;$1$2");
func.js;VOBSWeb/VobsWebUI/VaultWeb/func.js
, :
^.*?/\d+/([^/]+/).*?/\d+/([^/]+/).*?/\d+/([^/]+/).*?/\d+/([^/]+)
$4;$1$2$3$4.
#: resultString = Regex.Replace(subjectString, @"^.*?/\d+/([^/]+/).*?/\d+/([^/]+/).*?/\d+/([^/]+/).*?/\d+/([^/]+)", "$4;$1$2$3$4");
JavaScript: result = subject.replace(/^.*?\/\d+\/([^\/]+\/).*?\/\d+\/([^\/]+\/).*?\/\d+\/([^\/]+\/).*?\/\d+\/([^\/]+)/g, "$4;$1$2$3$4");
, ; , JavaScript .