I'm having trouble accessing the full list of results when I .exec()
a regular expression in Node. Here is my code:
var p = /(aaa)/g;
var t = "someaaa textaaa toaaa testaaa aaagainst";
p.exec(t);
> [ 'aaa', 'aaa', index: 4, input: 'someaaa textaaa toaaa testaaa aaagainst' ]
I only get two results, no matter what. Is my error on the RegExp itself?
Any help will be appreciated!