Per documentation: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/test#Description
test
called multiple times on the same global regular expression instance will advance past the previous match.
You can confirm this behavior:
var test = new RegExp( '[0-9]', 'g' );
test.test('01'); //true
test.test('01'); //true
test.test('01'); //false
It doesn't make sense to use the g
flag if all you want is to confirm a single match against various strings.