1 2 Previous Next 45 Replies Latest reply on Jul 1, 2018 4:08 AM by asdffffffffff

    How do I use GREP expression to keep the last two words of a paragraph together?


      Hi guys, I'm dealing with a document that's riddled with orphan, and want to use GREP to get rid of them all.


      I found this thread talking about how to keep all last 10 characters together. But in my language, you can have up to 4 words together (nearly a third of the sentence!) and still not break the 10-character limit. So if I use that expression, some sentence will get cut off midway, which make the whole paragraph looks horrendous. I also tried the (\s\w+.?)$ expression, but it left some orphans untouched (very random, no pattern at all).


      So is there any expression that can make the last 2 words of any paragraph stick together like glue?

        1 2 Previous Next