Hi AMDx64BT!
On Mo, 08 Nov 2010, AMDx64BT wrote:
> :%s/\_^\(.\{,40}\n\)\{4,}// works very well. I would like to do
> another question.
> Could be possible to delete all the sentences < 40 characters only
> when they are more than 3 times consecutives "but now keeping the last
> one undeleted of each group". I want to say this:
>
> Begining with this:
>
> xxxxxxxxxx
> xxxxxxxxxx
> xxxxxxxxxx
> xxxxxxxxxx
> xx--Title--xx
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> And obtain this:
>
> xx--Title--xx
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
:%s/\_^\%(.\{,40}\n\)\{3,}\(.\{,40}$\)/\1/
regards,
Christian
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php