I am sorry for the rather fuzzy title of my question. I am working on some text, which I take from web-page and try to annotate it with LaTeX commands using Vim.

How can I write in Vim following pattern:

dot line-break 2spaces capital letter

I have to search through the text to replace it. Thank you!


To match a dot followed by a new line beginning with two spaces and one capital letter you can use



\.        Matches a literal .
\n        is a new line
\s        is a whitespace
\{2}      is exactly 2 occurences of the previous atom (i.e. \s)
[A-Z]     is a capital letter between A and Z
|improve this answer|||||
  • Slightly shorter with \u instead of [A-Z], e.g. \.\n\s\{2}\u – Peter Rincker Mar 7 '18 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.