I have an identifiers of the elements, which look like this:
form_book_1_2_3
What I want is to replace second digit in this identifier with other value. I used function 'match' with the following regexp:
var regexp = /\d_(\d)_\d/;
But it returns me array containing
[1_2_3, 2]
So, when I try to use function 'replace' it actually replace '1_2_3' string instead of only '2'. I don't understand how to point to the second matched element in the replace function. Or maybe my regexp is wrong?