2008/10/8 Nate <[EMAIL PROTECTED]>:
>
> Hello,
>
> I'm trying to find a regex to remove the file extension from a list of
> files.
>
> For example,
>
> src/foo.txt
> src/bar.tgz
> .vim/myfile.vim
> project.git/index.html
>
> I need to do minimal matching, otherwise, the 3rd and 4th lines will
> be messed up.
>
> I've tried this search/replace:
> :%s/\..\{-}$//c
>
> However, vim will not do minimal matching on the 3rd line.
>
> What am I doing wrong?

It seems the regex is being read from left to right, so for each line
it will find the first literal dot, then the minimal amount of any
char, which naturally means to EOL.

The following works because something follows the minimal matching
part (but it doesn't do what you want, Ivan helped with that):
:%s/^.\{-}\.

Kind regards,
Erik Wognsen

>
> Thanks,
>
> ---Nate
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to