regex - Vim formula to leave only two first words in each line -



regex - Vim formula to leave only two first words in each line -

how leave 2 first words (remove rest) in each line in vim?

e.g.

aa aa subst:pl:acc:m3+subst:pl:acc:n2 aa advertisement acta brev:npun

into

aa aa aa advertisement

applied lines:

:%s/\v^(\s*\s+\s+\s+).+/\1/

regex vim replace

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -