Answers for "match string containing only numbers js"

2

js match any number string

const match = 'some/path/123'.match(/\/(\d+)/)
const id = match[1] // '123'
Posted by: Guest on June-26-2020

Code answers related to "match string containing only numbers js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language