Quick search for files of a length

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
cavaliersa
Junior Member
Junior Member
Posts: 8
Joined: 2012-10-23, 08:55 UTC
Location: South Africa

Quick search for files of a length

Post by *cavaliersa »

Is it possible to add functionality to allow for quick search to also search based on the filename length.

For example, assuming files
  1. AAA
  2. AAAA
  3. AAAAA
If I quick search for A###.* (assuming the amount of hashes to be the amount of extra characters making up the filename) then it will only return file 2.

Hope this explains this sufficiently.
User avatar
HolgerK
Power Member
Power Member
Posts: 5412
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

A???.

[x] Beginning (name must start with first typed character)
[x] Ending (last character before typed dot . must match)

Regards
Holger
cavaliersa
Junior Member
Junior Member
Posts: 8
Joined: 2012-10-23, 08:55 UTC
Location: South Africa

Post by *cavaliersa »

I'm looking for match on the length of the filename without matching the last character so don't think that will work.

In my example above I want to match a file that start's with A and is 4 characters long (so 3 hashes) and can have whatever file extension. I've tried the ? route but unfortunately it does not work for me, it includes files that are shorter than the amount of characters replaced. So A???. will show me both files 1 and 2.
User avatar
HolgerK
Power Member
Power Member
Posts: 5412
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

HolgerK wrote: [x] Beginning (name must start with first typed character)
[x] Ending (last character before typed dot . must match)
Did you set these options?

Regards
Holger
cavaliersa
Junior Member
Junior Member
Posts: 8
Joined: 2012-10-23, 08:55 UTC
Location: South Africa

Post by *cavaliersa »

*slaps forehead*

Apologies Holger, the Ending option had not been set (I could swear that I did). :oops:

This now works just fine. Thanks very much for this. :D
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

In QSX you may search with an regular expression like:

Code: Select all

?^a...\.

Code: Select all

?  - turns regular expression mode on
^  - matches the beginning of the file
a  - matches the char "a"
.  - matches any char
\. - matches a dot
User avatar
white
Power Member
Power Member
Posts: 6017
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

cavaliersa wrote:This now works just fine.
Not quite. Try:
  • a.js
    a.is.not.b.pdf
    aint.good.pdf
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

white wrote:
cavaliersa wrote:This now works just fine.
Not quite. Try:
  • a.js
    a.is.not.b.pdf
    aint.good.pdf
My solution isn't perfect either. But both solutions should fit most of the cases. Perhaps this one is perfect:

Code: Select all

?^a...\.[^\.]*$
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

[mod]Moved to the English forum.

Hacker (Moderator)[/mod]
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply