Pregunta

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.

¿Fue útil?

Solución

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

/\vdef\_.{-}end

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top