On Thu, 7 Aug 2025 14:11:08 -0500
Dirk Eddelbuettel <e...@debian.org> wrote:

> One suggestion is to use '*.sw[g-p]' to spare .swf files for Flash

On Unix-like systems (and, empirically, on Windows, despite ':help
swap-file' says the dots are replaced), Vim prepends a dot to the name
of the swap file. So how about only matching files that start with a
dot and end with .sw[certain letters]?

grepl(
 '(^|/)[.][^/]+[.]sw[a-p]$',
 c('.swap.file.swp', 'subdir/.swapfile.swn', 'not-a-swapfile.swc'),
 perl = TRUE
)
# [1]  TRUE TRUE FALSE

-- 
Best regards,
Ivan

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to