Consider the following regex -- /\d+([a-z]+)\d+/
and the following test string -- 345345dffdfd34534
example code --
var s = '345345dffdfd34534';
var result = s.match(/\d+([a-z]+)\d+/);
Why does javascript return an array instead of just the letters dffdfd
that match the capturing group when I try to match the string with regex ?
I know it's not a big deal but is this how it is supposed to work or am I doing somethinig wrong?
EDIT: I am not asking how to access the capturing group. I know it is just a case of looking up the array. But why does JS still return two results instead of whats just part of the capturing group?