Fuzzy search deals poorly with multiple periods and trailing whitespace

Bug #1172584 reported by Brian Murphy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Wah!Cade
Fix Committed
Undecided
Wayne Moulden

Bug Description

The regex for fuzzy search stops at the first period so that

    a.something.ext

returns "a". Fuzzy search also handles trailing whitespace poorly so that

    something (something).ext

returns "something " but

    something.ext

returns "something".

The following patch fixes these problems for me.

Related branches

Revision history for this message
Brian Murphy (the-brianmurphy) wrote :
Revision history for this message
Wayne Moulden (waynemou) wrote :

Thanks Brian I will look at your patch. The current version did need improvement.

Revision history for this message
Wayne Moulden (waynemou) wrote :

Please review & test commit 134, I went a slightly different way; I didn't want to be limited to a hardcoded assumption for file extension length. Please provide feedback once tested if possible.

We now strip the unwanted text from the filename before the search. You can throw the below information into regexr with global and multiline options turned on to see the results. (http://gskinner.com/RegExr/)

REGEX: ((\.[^\.]+$)|(\s\(.+(?<=(\)|\]|\s))\.[^\.]+$))

TEST DATA:
=========================================================
Alcazar - The Forgotten Fortress (1985) (Activision).rom
BABYBLU3_00528_01.zip
1942 The Pacific Air War (1994)(Microprose Software Inc)(Rev1).zip
Arcade Minor Emus - [RAW]men (v0.83) - mslug5.zip
duckhunt.zip
[GBA] Tony Hawk's Pro Skater 2 (Retail) (U).zip
[BIOS] Tiger Game.com (USA) (Internal)
a.something.ext
Atari PAM Diagnostics (USA) (v2.3).zip
A.C.U. Docs 01 - 08 Revisited (1991)(A.C.U.)(Disk 3 of 3).zip
CD-Boot v1.0 (19xx)(Amiga Legal Emulation)(PD).zip
Kickstart v1.2 r33.180 (1986)(Commodore)(A500-A1000-A2000)[!].zip
Kickstart v1.2 r33.180 (1986)(Commodore)(A500-A1000-A2000)[!] .zip

Revision history for this message
Wayne Moulden (waynemou) wrote :

RESULTS:
=========================================================
Alcazar - The Forgotten Fortress
BABYBLU3_00528_01
1942 The Pacific Air War
Arcade Minor Emus - [RAW]men (v0.83) - mslug5
duckhunt
[GBA] Tony Hawk's Pro Skater 2
[BIOS] Tiger Game
a.something
Atari PAM Diagnostics
A.C.U. Docs 01 - 08 Revisited
CD-Boot v1.0
Kickstart v1.2 r33.180
Kickstart v1.2 r33.180

Regex is comment #3 is ecapsulated in 1 set of additional uneeded parenthesis, will be fixed in next commit, has no impact on the functionality.

Changed in wahcade:
assignee: nobody → Wayne Moulden (waynemou)
status: New → In Progress
Wayne Moulden (waynemou)
Changed in wahcade:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.