发布网友 发布时间:2022-04-22 01:26
共1个回答
热心网友 时间:2023-07-23 04:43
var reg = /.*\([^\)\(\d]*(\d+)[^\)\(\d]*\).*/;
var str = "helloworld (1908)";
var result = str.replace(reg, "$1");
console.log(result);
str = "Hello world2 (1980/IIO)";
result = str.replace(reg, "$1");
console.log(result);