else if(preg_match('#/album/(?P<id>\d+)$#i', $uri, $matches))
{
$id = (int)$matches['id'];
}
var regex = /[/]{1}\w+[/]{1}\d+/ig;
var uri = '/album/1';
let m;
if ((m = regex.exec(uri)) !== null) {
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}