How to capture the following pattern using JavaScript regular expressions?
I would like to capture the first sequence of characters ending at a word boundary. The sequence length should be minimal and greater than N.
For example.
N = 6, input = "aa bb cc ddd ee" result = "aa bb cc" // the 1st minimal sequence ending at a word boundary > 6