For some time I\'ve been trying to understand regular expressions in JavaScript, but it is extremely complicated. You could tell me how do I redeem separately each of the values
var string = "/first/middle/last";
var pattern = /([^\/]+)/g;
var result = string.match(pattern);
for (var i = 0; i < result.length; ++i) {
var value = result[i];
alert(value);
}