Bug 335255

Summary: Quicksearch: non-alphanumeric characters in search term are ignored at word boundaries
Product: [Applications] kmail2 Reporter: Thomas Arend <thomas>
Component: searchAssignee: kdepim bugs <kdepim-bugs>
Status: CONFIRMED ---    
Severity: normal CC: brendon, kdenis, mikemol, thomas
Priority: NOR    
Version: 5.12.3   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Screenshot

Description Thomas Arend 2014-05-23 20:20:23 UTC
When filtering the mails in ten message list window for "***Spam***" also the mails containing " spam " are shown. Escaping the asterix \* does not work. 

Reproducible: Always

Steps to Reproduce:
1. Insert "***Spam***" into the quick filter. 

(I thing you will have some of these if not you are a lucky guy.)
Actual Results:  
All messages containing spam are listed.

Expected Results:  
Only messages containing ***Spam*** should be listed.

This is a mayor function - at least for me.
Comment 1 Thomas Arend 2014-07-17 19:39:54 UTC
Created attachment 87783 [details]
Screenshot

Screen shot of wrong search result!
Comment 2 Michael Mol 2016-06-29 18:04:57 UTC
It looks like non-alphanumeric characters get stripped from the search. I notice that "[" also gets omitted from my search terms.
Comment 3 Denis Kurz 2017-01-13 20:01:54 UTC
Interesting... Using the filter term "/)(}{CMake****>=[)( for \/{}*[]…download:-)(<>=" still lists the message with subject "[ANNOUNCE] CMake 3.7.2 available for download". Replacing "CMake" with "Make" or "CMak", or "download" with "ownload" or "downloa", however, does not yield any results. Using "fo" or "or" instead of "for" does not make a difference, because words with less than three letters are ignored.

Summary:
"*ABCDE" matches "ABCDE"
"ABCDE*" matches "ABCDE"
"*BCDE" does not match "ABCDE"
"ABCD*" does not match "ABCDE"

The last two cases might be especially confusing if you are used to certain regular expressions.

Obviously, only special characters at word boundaries are ignored. I'm pretty sure that most users would not expect this behaviour. Confirmed for 5.4.1.
Comment 4 Brendon Higgins 2020-03-31 16:41:36 UTC
Still present in 5.12.3 (currently in Debian). I was hoping to filter based on a specific hyphenated term, but of course I also get a ton of other messages that contain all of the words separately, because of this bug.