How can I get all groups of a regex match?
var str = "adam peter james sylvester sarah";
var regex = /what should my regex be t capture all names that has the letter a in them/
var match = regex.exec( text );
console.log(match)
What I want here is each name that has the letter a in it... I want to be able to capture several names preferably at the same time.
Is this possible?