. . . Thus simulating word wrap. Any guidance appreciated.
tcebob
Break a line at a word division <= 80 char.
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2459
- Joined: Sun Mar 02, 2003 9:22 pm
-
- Posts: 2459
- Joined: Sun Mar 02, 2003 9:22 pm
TextPad is incapable of matching text containing an arbitrary number of newlines. But if your paragraphs are already each on a single line, you can do something like this:
You have to Replace repeatedly, rather than Replace All once, as the recogniser fails to notice that it's at the beginning of a line when it's positioned immediately after a newline that's just been inserted in the course of the Replace All. This is a bug.
The above assumes you are using Posix regular expression syntax:
which puts an extra newline at the end of each paragraph.Find what: (.{1,80})( |$)
Replace with: \1\n
[X] Regular expression
You have to Replace repeatedly, rather than Replace All once, as the recogniser fails to notice that it's at the beginning of a line when it's positioned immediately after a newline that's just been inserted in the course of the Replace All. This is a bug.
The above assumes you are using Posix regular expression syntax:
With WildEdit (http://www.textpad.com/products/wildedit/) your paragraphs don't need to be on single lines:Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
Find what: (.{1,80})( |$)
Replace with: $1\n
[X] Regular expression
[X] Replacement format
Options
[ ] '.' does not match a newline character [i.e., not selected]