let input = "abcd"; let match = /b(c)/.exec(input); let indices = match.indices;
// `indices` has the same length as match indices.length === match.length
// The first element of `indices` contains the start/end indices of the match indices[0]; // [1, 3]; input.slice(indices[0][0], indices[0][1]); // same as match[0]
// The second element of `indices` contains the start/end indices of the first capture indices[1]; // [2, 3]; input.slice(indices[1][0], indices[1][1]); // same as match[1]);