Originally Posted by Logic Ali
I don't think you need the g flag here and its use increments the lastIndex property of the regex.
Teach me to not hit refresh.
Okay, I see it bumps lastIndex. But why does that matter, if you are doing a fresh call to test()???