Can someone help me to understand why using \\d* returns an array containing an empty string, whereas using \\d+ returns [\"100\"] (as expected). I get why the \\d+ works, b
As @StriplingWarrior said below, the empty string is the first match, hence it is being returned. I would like to add that you can tell what the regex is matching by noticing the 'index' field which the function match returns. For example, this is what I get when I run your code in Chrome:
["", index: 0, input: "one to 100"]