Page 1 of 1

Alt+F7 problem if dot in search string

Posted: 21 Sep 2009, 14:44
by TÜV
Alt+F7 search results are missing if there is a dot in the search string and the search string is not within asterisks.
Example: A file named "a.b.c.d.txt" is found by the input
*b.c*
but not by the input
b.c
like a file named "a-b-c-d.txt" is found by the input
b-c
Input of
"b.c"
causes the error message "File mask is syntactically incorrect."

Re: Alt+F7 problem if dot in search string

Posted: 21 Sep 2009, 15:19
by Ether
TÜV wrote:Alt+F7 search results are missing if there is a dot in the search string and the search string is not within asterisks.
That's not actually a problem, if you know what to expect.
TÜV wrote:Example: A file named "a.b.c.d.txt" is found by the input *b.c* but not by the input b.c like a file named "a-b-c-d.txt" is found by the input b-c
Find primarily looks for exact matches, that's the reason why 'b.c' doesn't find 'a.b.c.d.txt'. It also considers any wildcards entered (* and ?), so that '*b.c*' does find 'a.b.c.d.txt'.

For simplicity's sake, if you enter search term that doesn't look as an actual filename, i.e. it doesn't contain any dots, the term is automagically enclosed by asterisks. You can see that if you perform a more time expensive search (e.g. for 'abc' on C:) and look at the title of the Find window. That works as a substring search - finds everything that contains the search term (not just those that are named the same).
TÜV wrote:Input of "b.c" causes the error message "File mask is syntactically incorrect."
Quotation marks (") are not allowed in file names.

Re: Alt+F7 problem if dot in search string

Posted: 21 Sep 2009, 15:43
by Petr Solin
This is explained in Help (press F1 key in Find dialog) for Named box:
Important note: when you specify mask without asterisk (*), question mark (?), and point (.), you will find all files and directories whose names are containing this mask (e.g. when you specify "dog", you will find "dogs.txt", "hotdog.jpg", etc.), you can prevent this by adding point (.) to the end of such mask (e.g. when you specify "dog.", you will find only "dog").

search string syntax

Posted: 22 Sep 2009, 20:46
by TÜV
I used the F1 Help Index on
Regular Expressions Syntax
before posting the problem. There it says:
Altap Salamander uses this library to match regular expressions.
and
'.' - matches any single character (for example, 'do.' matches 'dog', 'dot', 'doe', etc.; 'd..r' matches 'door', 'deer', etc.)
In this help text a hint is missing that for Alt+F7 a different syntax is valid which can be found at
File Masks
.
File Masks
should be added in the Help Index.

At the moment
File Masks
is only a link inside
Find
.

Re: Alt+F7 problem if dot in search string

Posted: 22 Sep 2009, 20:58
by Jan Rysavy
Regular expressions are used for Search file content (try to clear the Search file content option to see dependent options) in the Find dialog box.
The Named field has nothing to do with regular expression. When you press F1 in the Find dialog box, you will see:
find.png
find.png (51.86 KiB) Viewed 10059 times

Re: Alt+F7 problem if dot in search string

Posted: 23 Sep 2009, 10:01
by th.
It says "adding point at the end of the mask" but in fact the substring search seems to be prohibited if there is a point in the mask at any position.

Re: Alt+F7 problem if dot in search string

Posted: 23 Sep 2009, 10:32
by mdruiter
Exactly: "when you specify mask without asterisk (*), question mark (?), and point (.), you will find all files ... containing this mask". But when you specify a mask WITH an *, ? or ., you will only find exact matches, i.e. no asterisks are added automatically.
I can understand this confuses you at first. Look at the Find window caption to see what happens.

Re: Alt+F7 problem if dot in search string

Posted: 23 Sep 2009, 11:04
by Ether
If you want to use substring search, enclose the search term with asterisks - that's the correct way and will work regardless of dots.

Re: Alt+F7 problem if dot in search string

Posted: 24 Sep 2009, 20:19
by SvA
What is this feature good for other than to confuse unsuspecting users like me?

Re: Alt+F7 problem if dot in search string

Posted: 24 Sep 2009, 20:41
by Ether
SvA wrote:What is this feature good for other than to confuse unsuspecting users like me?
In theory, you should know that if you want to use substring search, then you have to use asterisks. But Windows breaks that theory, because IIRC it uses substring search by default. To avoid possible confusion as to why Salamander doesn't/can't search for files in a similar manner, a simplification was made, so that if a simple query (no dots or wildcards) is entered in Salamander's Find, a substring search is performed.

Re: Alt+F7 problem if dot in search string

Posted: 24 Sep 2009, 20:48
by Jan Rysavy
Exactly, it was a very requested feature from people coming from Windows Find.