// the 'g' means a global search will be used > 'aaa'.match(/a/g) [ 'a', 'a', 'a' ] // here, without the g, the expression only matches once > 'aaa'.match(/a/) [ 'a', index: 0, input: 'aaa' ]