Find what: ([A-Z])\s(?=[A-Z]) Replace with: \1_ Match case
Also see Regex Lookahead and What is a regular expression for removing spaces between uppercase letters, but keeps spaces between words?