Page 1 of 1

Visual filter and square brackets

Posted: 17 Dec 2010 09:37
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

Re: Visual filter and square brackets

Posted: 17 Dec 2010 15:59
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

*[[]*]*

Re: Visual filter and square brackets

Posted: 18 Dec 2010 04:25
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.

Re: Visual filter and square brackets

Posted: 18 Dec 2010 09:10
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

*[[]*]*

Re: Visual filter and square brackets

Posted: 18 Dec 2010 14:37
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.

Re: Visual filter and square brackets

Posted: 18 Dec 2010 15:03
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;

Re: Visual filter and square brackets

Posted: 19 Dec 2010 05:52
by atjnjk
Thank you so much!