📅  最后修改于: 2022-03-11 15:01:25.636000             🧑  作者: Mango
string = "some string containing var userId = 117051";
var foundId = string.match(/var userId = (\d+)/)[1];
console.log(foundId); // "117051"