Visual filter and square brackets

Things you’d like to miss in the future...
Post Reply
atjnjk
Posts: 32
Joined: 04 Nov 2009 07:03

Visual filter and square brackets

Post by atjnjk »

I have some files like this:
New Textfile.txt
New Textfile-[test].txt
New Textfile-[test2].txt
New Textfile-[non].txt
New Textfile-[non2].txt
New Textfile-01-[non].txt

When I apply visual filter to those files, the list isn't what I expected:
Visual filter: Files shown in list
*[, [*, *], ]*, [*][/color], *[*][/color] or *[*]*[/color]: nothing
[test], [test2], *[test], *[test]*, [non] or [non2]: all files
New Textfile-[test] or any filename contains square brackets: nothing

But these are ok:
*[*, [, *]* or ]: all files contain "[" or "]"
[test: New Textfile-[test].txt, New Textfile-[test2].txt
[test2: New Textfile-[test2].txt
[non: New Textfile-[non].txt, New Textfile-[non2].txt, New Textfile-01-[non].txt
New Textfile-[test: New Textfile-[test].txt, New Textfile-[test2].txt

admin
Site Admin
Posts: 60569
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Visual filter and square brackets

Post by admin »

Opening square brackets must be surrounded by square brackets, else they are interpreted as group markers in pattern syntax:
Try this to find all "*[*]*":

Code: Select all

*[[]*]*

atjnjk
Posts: 32
Joined: 04 Nov 2009 07:03

Re: Visual filter and square brackets

Post by atjnjk »

If so, is there a way to visual filter selected files with names contain square brackets?
As I didn't find anything about square brackets in visual filter help, it would be nice to have it in the document.

admin
Site Admin
Posts: 60569
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Visual filter and square brackets

Post by admin »

atjnjk wrote:If so, is there a way to visual filter selected files with names contain square brackets?
As I didn't find anything about square brackets in visual filter help, it would be nice to have it in the document.
As I already posted:

Code: Select all

*[[]*]*

atjnjk
Posts: 32
Joined: 04 Nov 2009 07:03

Re: Visual filter and square brackets

Post by atjnjk »

admin wrote:As I already posted:

Code: Select all

*[[]*]*
Sorry, my last post is not as clear as I wanted, and I did read your previous post. What I want to know is if I select some files like: New Textfile-[test].txt, New Textfile-[test2].txt, is there a quick way to visual filter those files (show only those files in list)? I've read some posts about visual filtering selected files, but those scripts don't work with filenames contain square brackets.

admin
Site Admin
Posts: 60569
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Visual filter and square brackets

Post by admin »

atjnjk wrote:
admin wrote:As I already posted:

Code: Select all

*[[]*]*
Sorry, my last post is not as clear as I wanted, and I did read your previous post. What I want to know is if I select some files like: New Textfile-[test].txt, New Textfile-[test2].txt, is there a quick way to visual filter those files (show only those files in list)? I've read some posts about visual filtering selected files, but those scripts don't work with filenames contain square brackets.
Ah. In the next version use this:

Code: Select all

::filter '"sel" ' . get("SelectedItemsNames", "|"), 1;

atjnjk
Posts: 32
Joined: 04 Nov 2009 07:03

Re: Visual filter and square brackets

Post by atjnjk »

Thank you so much!

Post Reply