Вы можете использовать names are ([^.]+)
, чтобы сопоставить все до следующего периода.Затем используйте split
, чтобы получить имена в массиве
const str = 'The first sentence. Some second sentence. Third sentence and the names are John, Jane, Jen. Here is the fourth sentence about other stuff.'
const regex = /names are ([^.]+)/,
names = str.match(regex)[1],
array = names.split(/,\s*/)
console.log(array)