Observations from experiments with SETLABEL. The screen grab below is for reference. WhiteOnRed is configured for Files Only and is not a regular expression.
[ol][li]The wildcard string includes an underscore after the word Test but when applied it matches files with just test (no underscore). It may be relevant that the parent folder is named Test_Shortcut. If I rename it to Test-Shortcut the files are no longer matched.[/li][li]If I change the definition from Files Only to Folders Only, all folders contained inside a matched folder are highlighted, whether or not the folder name matches the wildcard.[/li][li]If I edit the label definition and change from Test_ to TestX the change is made OK, and takes immediate effect when I click Apply, but does not show up correctly in the Prefs window until I exit and reopen Prefs.[/li][/ol]
Regards, AB
I thought I'd give this a crack with Regex. I should have known better! It's not my forte and I always struggle. Here's my attempt to follow your suggestion, Leo. Per the screen grab, it doesn't do what I want, which is to apply the label only to the indicated file. Regex gurus are invited to point out where my hack has gone wrong.
It's the $ at the end that makes it work. Reg-exp often consider it a 'match' if any sub-string matches the expression. ^ and $ can be used to explicitly match the start and end of the string to ensure you match the whole thing (or you match a prefix or suffix).