I want to replace a number withing string since it can be done in regex but i don't know much about it here's my code
var rowNo=6;
var tName=jQuery(this).attr('name');
tName will be in this format
input_[3][InvoiceNo]
and I want to remove 3 and replace with rowNo value in regex
what i tried was this
replace(/[0-9]+/, rowNo)
but this replaces all numbers with rowNo. I don't want to do that, what I want is to replace 3 with rowNo.