Reputation: 6817
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.
Upvotes: 16
Views: 3897
Reputation: 91
In my version of Vim, you need to escape the {
, as well as using \_.
as other answers have said:
/def\_.\{-}end
Upvotes: 9
Reputation: 11703
Try following regex.
/\vdef(\n|.){-}end
.*
was culprit in your case
Upvotes: 6