Domanda

I am trying to search ruby file and find all methods (before autoreplacing them later). In vim, i use following regexp:

/\vdef.*(\n.*){-}end

However even though i use "{-}", it selects whole file's contents.

È stato utile?

Soluzione

uses \_. to include the newline character to the common ..

/\vdef\_.{-}end

Altri suggerimenti

In my version of Vim, you need to escape the {, as well as using \_. as other answers have said:

/def\_.\{-}end

Try following regex.

/\vdef(\n|.){-}end

.* was culprit in your case

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top