So I'm pulling in text from a csv and I am trying to find a way to prevent widows (where there is a single word on a line).
in JS we'd do this text = text.replace(/\s(?=[^\s]*$)/g, ' ');
But I can't seem to find a similar method in After Effects with expressions, to insert a nonbreaking space between the last word and the second last word in a string.