javascript if regular expression code example
Example 1: js match any number string
const match = 'some/path/123'.match(/\/(\d+)/)
const id = match[1] // '123'
Example 2: javascript inbuilt funcctions to match the word and return boolean
String.prototype.isMatch = function(s){
return this.match(s)!==null
}