18476Re: [Clip] Insert blank line between every line of text
- Oct 5, 2008--- In firstname.lastname@example.org, "Don - HtmlFixIt.com" <don@...>
> Okay, I give?
> .\K is what? anything but a line end?
> is not followed by another return or by file end? Is \Z a file end.
> | means or, correct?...
Regarding \K: "Do\Kn", for example, matches "Don" but returns the "n"
only. We could also use a Positive Lookbehind Assertion "(?<=Do)n"
("Do" preceding "n") but I like \K because it's shorter and, in
different cases, it doesn't a demand a fixed length of the pattern.
It just "dismisses" anything that precedes \K.
".\K\r\n(?!\r\n|\Z)" matches any single character "." followed by a
CR/NL without selecting (and replacing) this character. The CR/NL
must not be followed by another CR/NL (Negative Lookahead Assertion).
So the replacing doubles any CR/NL but skips over CR/NL in empty
If we've got an empty line following the last CR/NL, also this CR/NL
would be doubled because we've got a single character, a CR/NL and no
following CR/NL. To prevent this, an alternative \Z (matches at end
of string) is used as part of the Assertion (no CR/NL at end of
- << Previous post in topic Next post in topic >>