Gabor Grothendieck wrote:
> On Fri, Jan 9, 2009 at 4:20 PM, Wacek Kusnierczyk
>
>   
>> right;  there's a straightforward fix to my solution that accounts for
>> cases such as '.bashrc':
>>
>> names = c("foo.bar", ".zee")
>> sub("(.+)[.][^.]+$", "\\1", names)
>>
>> you could also use a lookbehind if possible (not in r, afaik).
>>
>>     
>
> or:
>
>   
>> sub(".*[.]", ".", names)
>>     
> [1] ".bar" ".zee"
>   

it was "foo" that was desired...

vQ

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to