Regularly match the numbers before the text

Page A total of 12 records per page

matches "12". How do you write it?

Dec.10,2021

let str = ' 1 12 ';
str.match(/(\d+)/);
console.log(RegExp.$1) //12

str.match(/\d+(?=)/g);
Menu