Skip to content
Prev 307889 / 398513 Next

listing the files in a directory using regular expressions

On Sun, Oct 14, 2012 at 3:13 AM, siddu479 <onlyfordigitalstuff at gmail.com> wrote:
1. Always read the help file:

?list.files

The argument name is path=, not dir=.

2. Also note that the pattern must be specified as a regular
expression and not a glob (as would be specified in a command line
shell).  For example, the B* part of the expression in your post means
0 or more B's.  It does not mean B followed by anything else.

If you want to use globs rather than regular expressions see

?glob2rx