I have a regular expression implemented in javascript that checks for all capital letters in a string:
.match(/[A-Z]+[^A-Z]*|[^A-Z]+/g)
then adds a space by .join(" ")
–
How can I write a regular expression that finds only the last capital letter instead, then joins a space before that letter? Thanks for your help.
—
Sample Input: "HelloMyNameIsNick"
Ideal Output: "HelloMyNameIs Nick"
