Improving inverted match
I'd like to show only .jpg (or .JPG) files in a multilevel directory tree. Unfortunately, from what I understand it's not currently possible to match dirs specifically.
What if dirs were matched with a trailing slash, as in:
# /file1.flac
# /file1.mp3
# /file2.mp3
# /subDir1/ <-- trailing slash
# /subDir1/file3.flac
This way it would be easy to create a regex to match jpgs or folders. What do you think of this?
That's a good idea. You can submit a patch.
to match dirs, I used ^\/subDir1(\/|$) (escaped).
This allows to access the dir directly, and sub-elements.
Not sure it is completely correct, but it worked for me.
I believe this ^^ directory-matching technique solves the problem
That works, but it also matches files that are called "subDir1".
I've made a patch that appends a slash when matching directories in https://github.com/gburca/rofs-filtered/pull/31. It will however break existing filters, please suggest how to make it backwards-compatible? The other option that would work for me (since I want to allow all directories) is to add DIR to the list of filetypes to match: |type:DIR