I would like to list all files in a directory that have "xyz" at the beginning and the first underscore has a 2 after it.
For example, xyzfjd_2_34_1.png
, xyz-39_2dog.jpg
would work, whereas xyzdog_3_dog.png
would not work.
I tried
list.files(dir, pattern="^xyz*_2*");
which is clearly wrong, mostly because I don't even know what I'm doing...