When operating tables by js, we often need to get or modify the subscript in name, such as: name="cust[1]/custName";
Replace: name.replace(/[/d]+/,num); //num is the numeric variable you need to replace
Get: name.match(/[/d]+/).
Get multiple: name.match(/[/d]+/g).
The above js intercept or replace the number implementation method in strings is all the content I have shared with you. I hope you can give you a reference and I hope you can support Wulin.com more.