Answers for "javascript access matched group in regex"

1

javascript access matched group in regex

string = "some string containing var userId = 117051";
var foundId = string.match(/var userId = (\d+)/)[1];
console.log(foundId); // "117051"
Posted by: Guest on May-31-2021

Code answers related to "javascript access matched group in regex"

Code answers related to "Javascript"

Browse Popular Code Answers by Language