Thursday, March 18, 2010

Non-Greedy Searching in Vim

So Regexes are very powerful. Until you want a non-greedy matching in Vim, then you'll go ``what?''.

Here's the incantation: \{-}. That's it. That will non-greedily match whatever preceded it.

No comments: