|
A user wrote:
I hope your plans include a feature to remove repeated (multiple, 3 or more in sequence) end of paragraph characters, during a "text cleanup". Of course I need two paragraph marks, one to end the paragraph, and one to provide one line space between paragraphs. In the editing work that I do, that is the single most irritating problem that I encounter, where the author puts more than two paragraph marks.
Your wish is granted! {poof!}
The RegEx Find & Replace can handle this easily. Well, it WOULD be easy if I were better at RegEx. But I figured it out.
Set as follows:
Find: (\x0D\x0A){3,} [x] RegEx? Repl: \x0D\x0A\x0D\x0A [x] RegEx? [ ] Line By Line?
Explanation: \x0D is a carriage return, \x0A is a linefeed, expressed in hexidecimal notation, understandable by the RegEx parser. By placing in round braces (), that groups them together so that the iterator {} can treat as a whole. 3 means "at least 3 of these", where "these" are the preceding pattern, which is treated as a whole due to the round braces. The comma after the 3 separates min/max. Here min is 3, and max is unlimited. I could have written {3,999} instead, for example. The max is optional, but the comma isn't - otherwise it would do "only 3". We're replacing with 2 carriage-return/linefeeds.
We're turning off the line-by-line option, so that the linebreaks are visible to the RegEx (otherwise it would not see them).
I will add this to the ClipMate help, under RegEx examples.
keywords: find replace regex linebreak removal
User Comments
RegEx - Remove 3 or more linebreaks
|
|
There are no user comments for this topic.
|
|
|
|