首页 > 代码库 > js match regex

js match regex

需要返回成数组元素的要放在括号里头

var arr = /input-([0-9]*)-([0-9]*)/.exec(id);var all = arr[0];var row = arr[1];var col = arr[2];

 

js match regex