I'm trying to capture names in a paragraph, and return them as an array. The sentence with the names contains "names are
". Example:
The first sentence. Some second sentence. Third sentence and the names are John, Jane, Jen. Here is the fourth sentence about other stuff.
Desired Output:
[ "John", "Jane", "Jen" ]
Attempt
paragraph.match(/names are ([A-Za-z ]+,{0,1} {0,1})+\./)