Currently, I am diving into the world of regex and encountering a set of strings formatted as "(9/13)". My goal is to retrieve the second number in this format. To achieve this, I experimented with the following regex pattern: /\(.*?[^\d]*(\d+?)\)/g
. When tested on an online regex tester, it functioned as expected.
However, when implemented like so:
var d = "(9/13)";
var v = /\(.*?[^\d]*(\d+?)\)/g;
alert(d.match(v));
The result was still "(9/13)". What could be the issue here?