js match any number string

JavaScript
const match = 'some/path/123'.match(/\/(\d+)/)
const id = match[1] // '123'
Source

Also in JavaScript: