开发者

request for the JavaScript regex for pattern

following is the string i have and i would like to read the number "10" (last inside the () )using regex. I am开发者_StackOverflow中文版 using Javascript.

"test me 234 and the (another) and test (10)"


Something like this:

var str = "test me 234 and the (another) and test (10)";
result = str.match(/\((\d+)\)$/);
console.log(result[1]);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜