需要返回成数组元素的要放在括号里头
var arr = /input-([0-9]*)-([0-9]*)/.exec(id); var all = arr[0]; var row = arr[1]; var col = arr[2];