
Thus text like this may result in my notes: After a weekend of emotional honesty at an Esalen-style retreat, Los Angeles sophisticates BobĪnd Carol Sanders (Robert Culp and Natalie Wood) return home determined to embrace complete openness. Often I take notes and tab sections over once or twice. Maybe this is a bit much to ask, but maybe I’ll lay it down as a challenge to interested parties. I see that chimed in just before me with a lookbehind solution. So it greedily takes up to 80 characters, followed by one or more horizontal spaces this should find the first space at or before the 80th char (so if the 80th char is a non-space, and 81st is a space, it still has 80 char per line). Not to be nit-picky - just wondering if it can be done and how.? I know RegEx, but some of the users on this sight blow my said in Line wrap in the current version:Īt the time I was answering the previous question, I couldn’t think of a way, but I think this does it: Of course I could pick column 72 for example, but if one line happens to have a 10 character word starting at column 72 it would still wrap after 80.Ĭan your RegEx be modified to do a “look-ahead” or “look-behind” to start at column X (80 for example) and then backtrack to the first space and then insert the \r\n? So my script wraps BEFORE column 80, yours would wrap after it. Your RegEx would start at column 80 and go forward to the first space it sees. One thing I noticed though is that to wrap a column 80 for example, my script finds column 80 and then backtracks to the first space it sees.

I remembered this thread and made a very complex NppExec script to do it and then came back here to post it and saw this one-liner RegEx - boy do I feel silly :-(

Willing to do a quick search/replace (regex) transformation on the text to do the (CC’ing another RegEx guru for potential help on this question - not urgent). Said in Line wrap in the current version:
