const str = "HERE'S AN UPPERCASE PART of the string"; const upperCaseWords = str.match(/([A-Z][A-Z]+|[A-Z])/g); console.log(upperCaseWords);